Ask / Submit
1

DialogHeader.extraContent read-only

asked 2018-12-21 16:36:24 +0300

Tanghus gravatar image

updated 2018-12-21 16:37:57 +0300

I was trying to find an easy way to show some info in at dialog, and stumbled over DialogHeader.extraContent, but it gives an error when running: Invalid property assignment: "extraContent" is a read-only property

Dialog {
id: timersDialog;
allowedOrientations: Orientation.Portrait | Orientation.Landscape;

DialogHeader {
    id: header;
    dialog: timersDialog
    title: "Title"
    extraContent: 
        Label {
            text: "Extra content"
        }
}}

What is the property exactly for then?

https://sailfishos.org/develop/docs/silica/qml-sailfishsilica-sailfish-silica-dialogheader.html/#extraContent-prop

edit retag flag offensive close delete

Comments

Long shot but try with reserveExtraContent bool set to true

Allstar12345 ( 2018-12-21 18:10:55 +0300 )edit

Good suggestion, but nope

Tanghus ( 2018-12-21 19:26:33 +0300 )edit

In documentation of reserveExtraContent it says: "This property defaults to true if extraContent has one or more children; otherwise false." so perhaps you could try add a child item to it, instead of using it directly. I believe you can also make a subclass of it...

Edit: That's what @coderus said.

Direc ( 2018-12-23 12:19:47 +0300 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2018-12-23 00:49:56 +0300

coderus gravatar image

updated 2018-12-23 00:50:11 +0300

Label {
    parent: dialogHeader.extraContent
    text: "Extra content"
}
edit flag offensive delete publish link more

Comments

Interesting. I'll give that a try. It should be added to the docs.

Tanghus ( 2018-12-23 11:02:49 +0300 )edit

It worked btw @coderus. I don't always ride the day I saddle ;)

Tanghus ( 2019-08-16 08:45:34 +0300 )edit
Login/Signup to Answer

Question tools

Follow
1 follower

Stats

Asked: 2018-12-21 16:36:24 +0300

Seen: 95 times

Last updated: Dec 23 '18