From d174c1069e64a497160c2619770ecc01141efa2f Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Tue, 10 Jul 2012 15:29:58 +1000 Subject: [PATCH] Re-enable tests dependent on QStandardItemModel. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit These were disabled when QtWidgets was not available, but that is no longer necessary following QStandardItemModel being moved to QtGui. Change-Id: I7ed133d9fd5ae6daa5ed9df180f7745fc3f368b1 Reviewed-by: Thorbjørn Lund Martsum Reviewed-by: Damian Jansen --- .../tst_qquickvisualdatamodel.cpp | 25 +++---------------- 1 files changed, 4 insertions(+), 21 deletions(-) diff --git a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp index 4684df2..54871c1 100644 --- a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp +++ b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp @@ -57,14 +57,13 @@ #include #include #include +#include using namespace QQuickVisualTestUtil; using namespace QQuickViewTestUtil; template int lengthOf(const T (&)[N]) { return N; } -#ifndef QT_NO_WIDGETS -#include static void initStandardTreeModel(QStandardItemModel *model) { QStandardItem *item; @@ -82,7 +81,6 @@ static void initStandardTreeModel(QStandardItemModel *model) item->setIcon(QIcon()); model->insertRow(2, item); } -#endif class SingleRoleModel : public QAbstractListModel { @@ -125,7 +123,6 @@ protected: } }; -#ifndef QT_NO_WIDGETS class StandardItem : public QObject, public QStandardItem { Q_OBJECT @@ -149,7 +146,6 @@ public: static_cast(property->object)->appendRow(item); } }; -#endif class DataSubObject : public QObject { @@ -261,10 +257,8 @@ public Q_SLOTS: QML_DECLARE_TYPE(SingleRoleModel) QML_DECLARE_TYPE(DataObject) -#ifndef QT_NO_WIDGETS QML_DECLARE_TYPE(StandardItem) QML_DECLARE_TYPE(StandardItemModel) -#endif class tst_qquickvisualdatamodel : public QQmlDataTest { @@ -275,7 +269,6 @@ public: private slots: void initTestCase(); void cleanupTestCase(); -#ifndef QT_NO_WIDGETS void rootIndex(); void updateLayout_data(); void updateLayout(); @@ -285,7 +278,6 @@ private slots: void noDelegate(); void itemsDestroyed_data(); void itemsDestroyed(); -#endif void objectListModel(); void singleRole(); void modelProperties(); @@ -373,10 +365,8 @@ void tst_qquickvisualdatamodel::initTestCase() qmlRegisterType("tst_qquickvisualdatamodel", 1, 0, "SingleRoleModel"); qmlRegisterType("tst_qquickvisualdatamodel", 1, 0, "DataObject"); -#ifndef QT_NO_WIDGETS qmlRegisterType("tst_qquickvisualdatamodel", 1, 0, "StandardItem"); qmlRegisterType("tst_qquickvisualdatamodel", 1, 0, "StandardItemModel"); -#endif engine.setIncubationController(&controller); } @@ -389,7 +379,6 @@ tst_qquickvisualdatamodel::tst_qquickvisualdatamodel() { } -#ifndef QT_NO_WIDGETS void tst_qquickvisualdatamodel::rootIndex() { QQmlEngine engine; @@ -531,7 +520,6 @@ void tst_qquickvisualdatamodel::childChanged() QVERIFY(name); QCOMPARE(name->text(), QString("Row 3 Item")); } -#endif void tst_qquickvisualdatamodel::objectListModel() { @@ -708,7 +696,6 @@ void tst_qquickvisualdatamodel::modelProperties() QCOMPARE(delegate->property("test8").toInt(),1); } -#ifndef QT_NO_WIDGETS { QQuickView view; @@ -750,11 +737,9 @@ void tst_qquickvisualdatamodel::modelProperties() QCOMPARE(delegate->property("test7").toInt(),1); QCOMPARE(delegate->property("test8").toInt(),1); } -#endif //### should also test QStringList and QVariantList } -#ifndef QT_NO_WIDGETS void tst_qquickvisualdatamodel::noDelegate_data() { QTest::addColumn("source"); @@ -818,7 +803,6 @@ void tst_qquickvisualdatamodel::itemsDestroyed() QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); QVERIFY(!delegate); } -#endif void tst_qquickvisualdatamodel::packagesDestroyed() { @@ -2476,7 +2460,7 @@ void tst_qquickvisualdatamodel::insert_data() << 4 << 5 << 0 << true << true << false << false << true << QString("name") << (QStringList() << "seven" << "one" << "two" << "three" << "four"); -#ifndef QT_NO_WIDGETS + // AbstractItemModel (Multiple Roles). QTest::newRow("StandardItemModel.items prepend") << multipleRoleSource[i] @@ -2557,7 +2541,7 @@ void tst_qquickvisualdatamodel::insert_data() << 4 << 5 << 0 << true << true << false << false << false << QString("display") << (QStringList() << "Row 7 Item" << "Row 1 Item" << "Row 2 Item" << "Row 3 Item" << "Row 4 Item"); -#endif + // StringList. QTest::newRow("StringList.items prepend") << stringListSource[i] @@ -3057,7 +3041,6 @@ void tst_qquickvisualdatamodel::resolve_data() << QString("name") << (QStringList() << "one" << "two" << "three" << "four"); -#ifndef QT_NO_WIDGETS // AbstractItemModel (Multiple Roles) QTest::newRow("StandardItemModel.items prepend, resolve prepended") << multipleRoleSource[i] @@ -3082,7 +3065,7 @@ void tst_qquickvisualdatamodel::resolve_data() << 5 << 4 << 4 << 2 << true << false << true << false << false << QString("display") << (QStringList() << "Row 1 Item" << "Row 2 Item" << "Row 3 Item" << "Row 4 Item"); -#endif + // StringList QTest::newRow("StringList.items prepend, resolve prepended") << stringListSource[i] -- 1.7.2.5