Make qmetaobject autotest independent of QtWidgets
authorDebao Zhang <dbzhang800@gmail.com>
Wed, 6 Jun 2012 01:54:09 +0000 (18:54 -0700)
committerQt by Nokia <qt-info@nokia.com>
Sun, 10 Jun 2012 22:37:01 +0000 (00:37 +0200)
Change-Id: I4340036a4e6024d9b8d0c7832ad7bfb28ec4bc99
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
tests/auto/corelib/kernel/qmetaobject/qmetaobject.pro
tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp

index a28b8a8..88c5f91 100644 (file)
@@ -1,5 +1,5 @@
 CONFIG += testcase
 CONFIG += parallel_test
 TARGET = tst_qmetaobject
-QT = core-private gui widgets testlib
+QT = core-private gui testlib
 SOURCES = tst_qmetaobject.cpp
index 78ca386..8725c93 100644 (file)
@@ -43,7 +43,7 @@
 
 #include <qobject.h>
 #include <qmetaobject.h>
-#include <qlabel.h>
+#include <qwindow.h>
 #include <private/qmetaobject_p.h>
 
 Q_DECLARE_METATYPE(const QMetaObject *)
@@ -720,13 +720,13 @@ void tst_QMetaObject::invokeBlockingQueuedMetaMember()
 void tst_QMetaObject::qtMetaObjectInheritance()
 {
     QVERIFY(QObject::staticMetaObject.superClass() == 0);
-    QCOMPARE(QLabel::staticMetaObject.indexOfEnumerator("Qt::Alignment"), -1);
-    QCOMPARE(QLabel::staticMetaObject.indexOfEnumerator("Alignment"), -1);
-    int indexOfAlignment = QLabel::staticMetaObject.indexOfProperty("alignment");
-    QVERIFY(indexOfAlignment != -1);
-    QMetaProperty alignment = QLabel::staticMetaObject.property(indexOfAlignment);
-    QVERIFY(alignment.isValid());
-    QCOMPARE(alignment.enumerator().name(), "Alignment");
+    QCOMPARE(QWindow::staticMetaObject.indexOfEnumerator("Qt::ScreenOrientation"), -1);
+    QCOMPARE(QWindow::staticMetaObject.indexOfEnumerator("ScreenOrientation"), -1);
+    int indexOfContentOrientation = QWindow::staticMetaObject.indexOfProperty("contentOrientation");
+    QVERIFY(indexOfContentOrientation != -1);
+    QMetaProperty contentOrientation = QWindow::staticMetaObject.property(indexOfContentOrientation);
+    QVERIFY(contentOrientation.isValid());
+    QCOMPARE(contentOrientation.enumerator().name(), "ScreenOrientation");
 }
 
 struct MyType