You need to use the Q_INVOKABLE macro for each method that you want to see in QMetaObject .
From the documentation :
Q_INVOKABLE
Apply this macro to member function declarations so that they can be called through a meta-object system. A macro is written before the return type, as shown in the following example:
class Window : public QWidget { Q_OBJECT public: Window(); void normalMethod(); Q_INVOKABLE void invokableMethod(); };
The invokableMethod () function is marked with Q_INVOKABLE, forcing it to register with the metaobject system and allowing it to be called with QMetaObject :: invokeMethod (). Since the normalMethod () function is not registered this way, it cannot be called with QMetaObject :: invokeMethod ().
You can also use the slots macro. I think Q_INVOKABLE might be more minimal.
QMetaObject only knows signals, slots, properties, and other calling member functions, sometimes called "meta methods" as a group.
Also, for the first line of your example, you should (probably) just call
const QMetaObject *metaobj = someClass->metaObject();
This is not just cosmetics. dynamic_cast carry out type checking at runtime, which is not necessary if you know at compile time that someClass is a pointer to a QObject -derived class. ( dynamic_cast ing to QObject* will work, and you will get the correct QMetaObject due to virtual inheritance, but it is not needed, less secure and unclear.)
You really don't need an instance of the class to get the meta object:
const QMetaObject *metaobj = SomeClass::staticMetaObject();
This is possible because there is one QMetaObject for each class, and not for each object.
For those who want to know more about the metaobject system, I recommend coffee and documentation . Normally, you do not need to directly access QMetaObject instances unless you are writing a script or something equally βmetaβ. Easily inadvertently duplicating Qt functionality already provides.
Also, Q_DECLARE_METATYPE not what you want.