Get a c++ object in QML and use it in javascript -
i'm making application in i'd call function qml in c++ source, , c++ function return me , object can use same properties in javascript part of qml. i've made connection , everything. i've tried send qvariantmap , tried use object in javascript, don't properties of object
there 2 ways exporting qobject based types c++ qml:
- return standalone qobject directly property reader or q_invokable function. note, object returned property has c++ ownership, q_invokable-object has js ownership. can change default behaviour via http://doc.qt.nokia.com/4.7/qdeclarativeengine.html#setobjectownership.
- return array of qobjects. in case should use qobjectlist, qdeclarativepropertymap (not qvariantmap) or qabstractlistmodel.
Comments
Post a Comment