c++ - Can I use QScriptEngine.toScriptValue with a QPointer to a QObject? -


the documentation on working qtscript , converting , forth between script values , c++ mentions can use qscriptengine.toscriptvalue qobject* type , have work automatically, casting object , returning script reference accordingly. same behavior hold qpointer<qobject> or have create own metatype? if so, work dealing qpointers qobject subclass?

the main thing i'm interested in whether or not properties declared using q_property of qobject subclass automatically brought script if call qscriptengine.toscriptvalue on qpointer subclass instance instead of regular pointer.

i had create own script metatype qpointer converted properly, didn't work out of box. however, qt documentation mentions there's no point in specifying pointers qpointers outside of initializaiton, since qpointers can treated regular pointers, might have been pointless.


Comments