Re: [Interest] Setting propery values on Q_GADGET-based objects in qml possible?

2017-06-28 Thread Tomasz Siekierda
I've had similar problem and did not find a solution at the time. While getMyself() feels hackish, it does indeed work. Thanks a lot for sharing! :-) On 20 June 2017 at 15:06, Ola Røer Thorsen wrote: > > 2017-06-20 13:52 GMT+02:00 Ola Røer Thorsen : >

Re: [Interest] Setting propery values on Q_GADGET-based objects in qml possible?

2017-06-20 Thread Ola Røer Thorsen
2017-06-20 13:52 GMT+02:00 Ola Røer Thorsen : > function doStuff() { >var o = theGadget; >console.log("o.name"); // prints "Name" >o.name = "Some other name"; // No error, but nothing really happens > either >console.log("o.name"); // Still prints "Name"

[Interest] Setting propery values on Q_GADGET-based objects in qml possible?

2017-06-20 Thread Ola Røer Thorsen
Hi all, I have a Q_GADGET-based class with properties that I instantiate in C++ and expose to qml via QVariant in a list model. The class is registered to Qt and Qml using Q_DECLARE_METATYPE, qRegisterMetaType and qmlRegisterUncreatableType. The properties are defined like this: class MyGadget