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

mathias.malmqvist at nokia.com mathias.malmqvist at nokia.com
Fri Dec 17 15:43:44 CET 2010


Please vote for these

http://bugreports.qt.nokia.com/browse/QTBUG-14986
http://bugreports.qt.nokia.com/browse/QTBUG-14864


Cheers
Mathias

________________________________________
From: qt-qml-bounces+mathias.malmqvist=nokia.com at qt.nokia.com [qt-qml-bounces+mathias.malmqvist=nokia.com at qt.nokia.com] On Behalf Of ext Ville M. Vainio [vivainio at gmail.com]
Sent: Friday, December 17, 2010 1:54 PM
To: qt-qml
Subject: [Qt-qml] Cannot store javascript object in property, why?

Currently, you cannot store javascript objects as properties in qml
components, e.g. you can't do

propery JSRef myobj

function setCallback(f) { myobj = f };

On irc #qt-qml, this explanation was quoted:

QQQ
In QML "property var" cannot store JavaScript native objects, as we
cannot bind to them. This might change in a future release. For now,
more explicit warnings are generated when you accidentally do this.
QQQ

I can't claim to understand the explanation, but I'm curious whether
we will have this feature in the near future - as the lack of it seems
to be a pretty fundamental shortcoming in QML, and workarounds (like
storing the reference in a .js file, or using C++) seem quite hacky in
comparison.

--
Ville M. Vainio @@ Forum Nokia
_______________________________________________
Qt-qml mailing list
Qt-qml at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-qml


More information about the Qt-qml mailing list