[Qt-qml] Cannot store javascript object in property, why?

Ville M. Vainio vivainio at gmail.com
Mon Jan 3 12:30:27 CET 2011


On Tue, Dec 21, 2010 at 4:39 PM, Ville M. Vainio <vivainio at gmail.com> wrote:

> If we don't get a "direct" syntax for this, I can envision using hacks like
>
> QtObject {
>  id: root
>
> ...
>
>  setPriv(root, "myobj", obj)
>
> ...
>
>  priv(root, "myobj").doStuff()
>
> ...
> }

I present such a hack at:

http://wiki.forum.nokia.com/index.php/Store_JavaScript_object_references_in_QML_objects

If anyone knows a faster way to get identity hash  for a QML object
(like python's id(myobject) ) than toString() without using C++, let
me know.

-- 
Ville M. Vainio @@ Forum Nokia


More information about the Qt-qml mailing list