[Qt-qml] Accessing dynamic properties

jamey.hicks at nokia.com jamey.hicks at nokia.com
Tue Sep 14 18:20:07 CEST 2010


How did you pass in the object? If you pass it as a QVariant you need to cast it to QObject * first to make its slots and properties available.

Jamey
-----Original Message-----
From: Dzyubenko Denis (Nokia-MS-Qt/Oslo)
Sent:  14/09/2010, 11:55  AM
To: Hicks Jamey (Nokia-NRC/Cambridge)
Cc: qt-qml at trolltech.com; Albisser Zeno (Nokia-MS/Oslo)
Subject: Re: [Qt-qml] Accessing dynamic properties

Hi,

On 14. sep. 2010, at 17.29, Hicks Jamey (Nokia-NRC/Cambridge) wrote:

>
> If variable o is bound to your object, then this will do the trick:
>       o.foo

nope, this just gives me undefined at run-time:

console.log("foo = ", myobject.foo)

the output:
"foo = undefined"

Denis.





More information about the Qt-qml mailing list