Re: [Interest] QMetaType create

2016-10-06 Thread Jérôme Godbout
For the other peoples that may look for this into the future: 2 options: - Constructor need to be Q_INVOKABLE (a little bit of a bummer if you have a library that use Qt and your not resposible for it, in my case I think I will go with this) - Specialize the template<>qMetaTypeConstru

Re: [Interest] QMetaType create

2016-10-06 Thread Jérôme Godbout
Yeah you're right, the ctor executed during the call is indeed a pointer type (8 bytes, 64 bits platform). Thanks for the pointer, punt intended ;-) Jerome On Wed, Oct 5, 2016 at 11:42 PM, Konstantin Shegunov wrote: > On Wed, Oct 5, 2016 at 11:42 PM, Jérôme Godbout > wrote: > >> Hi, >> I was

Re: [Interest] QMetaType create

2016-10-05 Thread Konstantin Shegunov
On Wed, Oct 5, 2016 at 11:42 PM, Jérôme Godbout wrote: > Hi, > I was looking for a way to create object dynamicaly out of a classname. I > have the classname which I can convert properly to QMetaType. > Hi, My best guess is you're creating a pointer to the object, not the object itself. Have you

[Interest] QMetaType create

2016-10-05 Thread Jérôme Godbout
Hi, I was looking for a way to create object dynamicaly out of a classname. I have the classname which I can convert properly to QMetaType. If the constructor is Q_INVOKABLE I can use the QMetaObject to create a newInstance() and this work properly into the example. But when this doesn't work, I'