Is there a way to get the class name of a derived QObject class without instantiating this class?

I am looking for something like this:

MyClass::metaObject()->className()

which does not work, because at the time this code is executed, there is no instance of MyClass.

If possible, is there a way to get all the class names that were obtained from MyClass?

+5
source share
1 answer

Use a static meta object :

 MyClass::staticMetaObject.className()

Work!

+14
source

All Articles