Russell, Matthew
2017-04-13 18:31:23 UTC
Why can my Q_GADGET be read perfectly in QML (JS) but not my Q_OBJECT?
I created a class, registered it (Q_DECLARE_METATYPE), and then push instances of it into a QVariantMap. If the object is a Q_GADGET my JS can read it perfectly, but when I switch it to a Q_OBJECT, the objects are blank.
I placed some code examples on SO here: http://stackoverflow.com/questions/43398740/qml-can-see-my-q-gadget-but-not-q-object
Basically I've narrowed it down to Q_GADGET vs Q_OBJECT, nothing else seems to make any difference. I'd prefer to use Q_OBJECT so that I can use signals and other objects in the QML/JS can bind to them.
Thanks.
I created a class, registered it (Q_DECLARE_METATYPE), and then push instances of it into a QVariantMap. If the object is a Q_GADGET my JS can read it perfectly, but when I switch it to a Q_OBJECT, the objects are blank.
I placed some code examples on SO here: http://stackoverflow.com/questions/43398740/qml-can-see-my-q-gadget-but-not-q-object
Basically I've narrowed it down to Q_GADGET vs Q_OBJECT, nothing else seems to make any difference. I'd prefer to use Q_OBJECT so that I can use signals and other objects in the QML/JS can bind to them.
Thanks.