[Qt-qml] Avoid binding warnings on object creation

martin.jones at nokia.com martin.jones at nokia.com
Fri Sep 3 00:13:42 CEST 2010


This is a bug.  The attached patch fixes it.

BR,
Martin.

-----Original Message-----
From: qt-qml-bounces at trolltech.com [mailto:qt-qml-bounces at 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 at 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 at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml
-------------- next part --------------
A non-text attachment was scrubbed...
Name: createobject.diff
Type: application/octet-stream
Size: 1123 bytes
Desc: createobject.diff
Url : http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20100903/9a3f2347/attachment.obj 


More information about the Qt-qml mailing list