Solved QMetaType::metaObjectForType returns NULL
-
Hi;
QMetaType::metaObjectForType(QMetaType::type("IChRSMSession*")) returns NULL.
IChRSMSession is interface that defined in DLL/Library as above;
class IChRSMSession
{
Q_GADGET
..
};QT_BEGIN_NAMESPACE
#define IChRSMSession_IID "com.motiontrue.plugins.IChRSMSession"
Q_DECLARE_INTERFACE(IChRSMSession, IChRSMSession_IID)
QT_END_NAMESPACE
Q_DECLARE_METATYPE(IChRSMSession*)
-
@VeNToR Did you register it using http://doc.qt.io/qt-5/qmetatype.html#qRegisterMetaType ?
-
@jsulm Yes, I did. qRegisterMetaType<IChRSMSession*>();
-
Hi,
Because there are none. A
Q_GADGET
is not a QObject based class. You only have the staticMetaObject like describe in the macro documentation. -
As @SGaist said there's no such thing, but to pile on
IChRSMSession*
isn't even a gadget it's simply a pointer. -
Thanks your returns. I wrote virtual function to get QMetaObject of the up class of interface class.
-
How did you do that ?