File indexing completed on 2024-05-05 05:41:36

0001 #include <QtCore/QCoreApplication>
0002 #include <QtCore/QObject>
0003 
0004 static QObject *s_obj;
0005 extern QObject *getObject();
0006 
0007 class A : public QObject
0008 {
0009 public:
0010     void childEvent(QChildEvent *ev)
0011     {
0012         auto obj1 = qobject_cast<QCoreApplication*>(ev->child()); // Warning
0013         auto obj2 = qobject_cast<QCoreApplication*>(s_obj); // OK
0014         auto obj3 = qobject_cast<QCoreApplication*>(getObject()); // OK
0015     }
0016 };
0017