Hi!
In order to an item to be shown on the screen, it needs to belong to the
scene graph, that is, to the three of items that are painted.
When you do this:
Rectangle {
Text {
text: "pindamonhangaba"
}
}
Text is implicitly(*) added as a child of Rectangle, thus it is painted.
However, when you create an item in the context of a property definition,
like in:
Rectangle {
property Text myProperty: Text {
text: "foobar"
}
}
It is not added to the scene graph, thus not painted.
* * *
How do I display myText1?
You can either create it in the scene graph directly and fill the property
with its id.
Rectangle {
property Text myProperty: myText
Text {
id: myText
text: "foobar"
}
}
or else, use a Loader to show it somewhere else:
Rectangle {
Loader {
delegate: myProperty // assuming this is an initialized property
of type Text
}
}
(*) See the documentation regarding default properties in Qml for more
detail on why is that.
BR,
Eduardo
--
Eduardo M. Fleury
OpenBossa - INdT
http://eduardofleury.com/
http://www.openbossa.org/
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-qml