[Qt-qml] Avoid binding warnings on object creation
Adriano Rezende
adriano.rezende at openbossa.org
Thu Sep 2 19:00:56 CEST 2010
> I am using the Component::createObject(parent) and inside the component I
> have bindings to its parent, like:
> Item {
> id: page
> // FIXME: the line below creates warnings when the page component is
> instantiated
> width: parent.width
> }
>
> I get these warnings when instantiating the page: "Unable to assign
> undefined value"
>
> Is there any workaround for avoiding these binding's warnings when
> instantiating a dynamic object?
I think this is the same problem I was facing.
I created a suggestion in JIRA related to this behavior:
http://bugreports.qt.nokia.com/browse/QTBUG-13170
The problem is that when creating an object dynamically, the parent is
set after all properties have been initialized. So, the parent itself
does not exist at the initialization time.
Br,
Adriano
More information about the Qt-qml
mailing list