rewrite qtMetaObjectInheritance() without gui

Change-Id: Ie024a3ee755cfe4996ed442686cd73ce13a2d5ff
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
Oswald Buddenhagen 2013-10-08 14:48:25 +02:00 committed by The Qt Project
parent 90c65880b0
commit 580096d611
2 changed files with 9 additions and 9 deletions

View File

@ -1,6 +1,6 @@
CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qmetaobject
QT = core-private gui testlib
QT = core-private testlib
SOURCES = tst_qmetaobject.cpp
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0

View File

@ -43,7 +43,7 @@
#include <qobject.h>
#include <qmetaobject.h>
#include <qwindow.h>
#include <qabstractproxymodel.h>
#include <private/qmetaobject_p.h>
Q_DECLARE_METATYPE(const QMetaObject *)
@ -746,13 +746,13 @@ void tst_QMetaObject::invokeBlockingQueuedMetaMember()
void tst_QMetaObject::qtMetaObjectInheritance()
{
QVERIFY(QObject::staticMetaObject.superClass() == 0);
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");
QCOMPARE(QSortFilterProxyModel::staticMetaObject.indexOfEnumerator("Qt::CaseSensitivity"), -1);
QCOMPARE(QSortFilterProxyModel::staticMetaObject.indexOfEnumerator("CaseSensitivity"), -1);
int indexOfSortCaseSensitivity = QSortFilterProxyModel::staticMetaObject.indexOfProperty("sortCaseSensitivity");
QVERIFY(indexOfSortCaseSensitivity != -1);
QMetaProperty sortCaseSensitivity = QSortFilterProxyModel::staticMetaObject.property(indexOfSortCaseSensitivity);
QVERIFY(sortCaseSensitivity.isValid());
QCOMPARE(sortCaseSensitivity.enumerator().name(), "CaseSensitivity");
}
struct MyType