If you use qobject_cast, there is really no point in comparing class names yourself using QMetaObject::className(). Just make the cast and see if resulting pointer is null or not. And remember meta-object for a class is only generated if the class contains the Q_OBJECT macro.





Reply With Quote
thanks for your help! Yeah ive gotten the classes written correctly ive seen people forget to include the Q_OBJECT line a lot.

Bookmarks