#include struct MyObj : public QObject {}; void testQObjectCast(QObject *o) { dynamic_cast(o); // OK }