I'm looking for something like this:
MyClass::metaObject()->className()
which doesn't work because at the point where this code is executed, there exists no instantiation of MyClass.
If this is somehow possible, is there a way of getting all names of the classes that have been derived from MyClass?
Use the static meta object:
MyClass::staticMetaObject.className()
Works!
You should be able to use:
obj->metaObject()->className();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With