Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Contributor
nrjg
Posts: 44
Registered: ‎09-14-2012
My Device: BB 10 Dev alpha

QObject* from QVariant

[ Edited ]

I have QVariant instance which I get from QML definded JS function by QMetaObject::invokeMethod.

It QVariant instance contains QObject pointer.

 

How can I get this pointer from QVariant object?

 

This method considered in SO doesn't works and fails with error (no matching function call).

Please use plain text.
Contributor
nrjg
Posts: 44
Registered: ‎09-14-2012
My Device: BB 10 Dev alpha

Re: QObject* from QVariant

[ Edited ]

I already found solution, just use:

  qvariant_cast<QObject*>(qvariantInstance) 

You also can use any another type instead of QObject* which you are expected.

Please use plain text.