[Qt-interest] Retrieving QMetaObject from a Qt Meta Type ID
BRM
bm_witness at yahoo.com
Mon Jan 24 19:19:38 CET 2011
Try using qobject_cast() on the pointer value stored in it. It'll return NULL if
it can't convert it a QObject.
Ben
----- Original Message ----
> From: Gustavo de Sá Carvalho Honorato <gustavohonorato at gmail.com>
> To: qt-interest at qt.nokia.com
> Sent: Mon, January 24, 2011 12:04:56 PM
> Subject: [Qt-interest] Retrieving QMetaObject from a Qt Meta Type ID
>
> Hi,
>
> I have a method that returns QVariant with any type. I have some
> pointer types pointing to an object derived from QObject, which are
> registered using Q_DECLARE_METATYPE. When this method returns these
> pointers to QObject derived objects, I need to list all properties,
> slots and others thinks related to its meta object. The problem is
> that I didn't find any way disconver if this QVariant is holding a
> pointer to a QObject derived type to get the QMetaObject and finally
> list the properties. The purpouse of this is to expose QObject to a
> scripting system, like QScriptEngine does.
>
> Any ideas?
>
> Thanks in advance,
> Gustavo
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list