This is a bug.  The attached patch fixes it.

BR,
Martin.

-----Original Message-----
From: qt-qml-boun...@trolltech.com [mailto:qt-qml-boun...@trolltech.com] On 
Behalf Of ext Adriano Rezende
Sent: Friday, 3 September 2010 3:01 AM
To: Cunha Leo (Nokia-MS-Qt/Oslo)
Cc: qt-qml@trolltech.com
Subject: Re: [Qt-qml] Avoid binding warnings on object creation

> 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

_______________________________________________
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml

Attachment: createobject.diff
Description: createobject.diff

_______________________________________________
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml

Reply via email to