[Qt-interest] Comparing two QMetaObjects

Richard Moore richmoore44 at gmail.com
Sun Feb 6 22:00:43 CET 2011


2011/2/4 Gustavo de Sá Carvalho Honorato <gustavohonorato at gmail.com>:
> What is the best way to compare two QMetaObjects? I've tried this, but
> did not work:
>
> object->metaObject() != QObject::staticMetaObject
>
> I would like the same behave as in Java:
>
> object.getClass() != Object.class

Compare the className() of the metaObject. Note though that trying to
pretend that Qt and C++ are java is likely to lead to poor code.

Rich.



More information about the Qt-interest-old mailing list