Tag* tag = new Tag(); Tag* tag_cast = qobject_cast<QObject*>(tag); if(tag_cast) qDebug() << "Cool!"; else qDebug() << "oh..";