diff options
author | Martin Jones <martin.jones@nokia.com> | 2012-06-01 14:53:26 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-05 04:35:50 +0200 |
commit | 805c30e809a86cc1feabeb3bdbee943a7bbf8796 (patch) | |
tree | 102ce2b32ceacb9b6522d579d8250892e1fdf276 | |
parent | c734706c69ed5b38cc97aea5be3f0553c194aa0a (diff) |
Allow qtdeclarative to compile with -no-widgets
We have no hard requirement for QtWidgets library, so we should
build without it.
Change-Id: I85c85cc1a52bf9daa7ab7916f19bf7cc3ad5845f
Reviewed-by: Damian Jansen <damian.jansen@nokia.com>
14 files changed, 70 insertions, 23 deletions
diff --git a/examples/qml/cppextensions/referenceexamples/referenceexamples.pro b/examples/qml/cppextensions/referenceexamples/referenceexamples.pro index 505cefd331..4bfbd488ea 100644 --- a/examples/qml/cppextensions/referenceexamples/referenceexamples.pro +++ b/examples/qml/cppextensions/referenceexamples/referenceexamples.pro @@ -6,9 +6,10 @@ SUBDIRS += \ binding \ coercion \ default \ - extended \ grouped \ properties \ signal \ valuesource \ methods + +!contains(QT_CONFIG, no-widgets): SUBDIRS += extended diff --git a/sync.profile b/sync.profile index f7a74f2db5..d4f22c7eef 100644 --- a/sync.profile +++ b/sync.profile @@ -13,7 +13,6 @@ ); %mastercontent = ( "gui" => "#include <QtGui/QtGui>\n", - "script" => "#include <QtScript/QtScript>\n", "network" => "#include <QtNetwork/QtNetwork>\n", "testlib" => "#include <QtTest/QtTest>\n", "qml" => "#include <QtQml/QtQml>\n", diff --git a/tests/auto/qml/qml.pro b/tests/auto/qml/qml.pro index d99d18c152..dc6c0def56 100644 --- a/tests/auto/qml/qml.pro +++ b/tests/auto/qml/qml.pro @@ -5,8 +5,6 @@ METATYPETESTS += \ PUBLICTESTS += \ parserstress \ - qjsengine \ - qjsvalue \ qjsvalueiterator \ qjsonbinding \ qmlmin \ @@ -50,6 +48,15 @@ PRIVATETESTS += \ qqmlbundle \ v4 +!contains(QT_CONFIG, no-widgets) { + PUBLICTESTS += \ + qjsengine \ + qjsvalue + + PRIVATETESTS += \ + qqmlecmascript +} + SUBDIRS += $$PUBLICTESTS SUBDIRS += $$METATYPETESTS SUBDIRS += debugger diff --git a/tests/auto/qml/qqmlecmascript/qqmlecmascript.pro b/tests/auto/qml/qqmlecmascript/qqmlecmascript.pro index 42c7bd91de..8de609d9d6 100644 --- a/tests/auto/qml/qqmlecmascript/qqmlecmascript.pro +++ b/tests/auto/qml/qqmlecmascript/qqmlecmascript.pro @@ -16,4 +16,6 @@ include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private network widgets testlib +QT += core-private gui-private v8-private qml-private network testlib +!contains(QT_CONFIG, no-widgets): QT += widgets + diff --git a/tests/auto/qml/qqmlecmascript/testtypes.cpp b/tests/auto/qml/qqmlecmascript/testtypes.cpp index fba6cb36e8..8fd160513c 100644 --- a/tests/auto/qml/qqmlecmascript/testtypes.cpp +++ b/tests/auto/qml/qqmlecmascript/testtypes.cpp @@ -39,8 +39,10 @@ ** ****************************************************************************/ #include "testtypes.h" -#include <QWidget> -#include <QPlainTextEdit> +#ifndef QT_NO_WIDGETS +# include <QWidget> +# include <QPlainTextEdit> +#endif #include <QQmlEngine> #include <QJSEngine> #include <QThread> @@ -201,8 +203,10 @@ void registerTypes() // MyRevisionedSubclass 1.1 uses MyRevisionedClass revision 1 qmlRegisterType<MyRevisionedSubclass,1>("Qt.test",1,1,"MyRevisionedSubclass"); +#ifndef QT_NO_WIDGETS qmlRegisterExtendedType<QWidget,QWidgetDeclarativeUI>("Qt.test",1,0,"QWidget"); qmlRegisterType<QPlainTextEdit>("Qt.test",1,0,"QPlainTextEdit"); +#endif qRegisterMetaType<MyQmlObject::MyType>("MyQmlObject::MyType"); diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 45005e68c1..18743ac57d 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -190,7 +190,9 @@ private slots: void qtbug_21580(); void singleV8BindingDestroyedDuringEvaluation(); void bug1(); +#ifndef QT_NO_WIDGETS void bug2(); +#endif void dynamicCreationCrash(); void dynamicCreationOwnership(); void regExpBug(); @@ -2042,6 +2044,7 @@ void tst_qqmlecmascript::bug1() delete object; } +#ifndef QT_NO_WIDGETS void tst_qqmlecmascript::bug2() { QQmlComponent component(&engine); @@ -2052,6 +2055,7 @@ void tst_qqmlecmascript::bug2() delete object; } +#endif // Don't crash in createObject when the component has errors. void tst_qqmlecmascript::dynamicCreationCrash() diff --git a/tests/auto/quick/qquickanimations/qquickanimations.pro b/tests/auto/quick/qquickanimations/qquickanimations.pro index 5c0bd3a2d4..fa8ec3f566 100644 --- a/tests/auto/quick/qquickanimations/qquickanimations.pro +++ b/tests/auto/quick/qquickanimations/qquickanimations.pro @@ -10,7 +10,7 @@ TESTDATA = data/* CONFIG += parallel_test -QT += core-private gui-private v8-private qml-private quick-private testlib widgets +QT += core-private gui-private v8-private qml-private quick-private testlib # QTBUG-23385 - color mixing tests failing on Ubuntu 11.10 x64 linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):DEFINES+=UBUNTU_ONEIRIC diff --git a/tests/auto/quick/qquickpathview/qquickpathview.pro b/tests/auto/quick/qquickpathview/qquickpathview.pro index 02ce905494..4326ef5288 100644 --- a/tests/auto/quick/qquickpathview/qquickpathview.pro +++ b/tests/auto/quick/qquickpathview/qquickpathview.pro @@ -9,4 +9,5 @@ include (../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private widgets testlib +QT += core-private gui-private v8-private qml-private quick-private testlib +!contains(QT_CONFIG, no-widgets): QT += widgets diff --git a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp index ef9a404e6c..5c0df1612f 100644 --- a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp +++ b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp @@ -53,7 +53,6 @@ #include <QtQml/private/qquicklistmodel_p.h> #include <QtQml/private/qqmlvaluetype_p.h> #include <QStringListModel> -#include <QStandardItemModel> #include <QFile> #include "../../shared/util.h" @@ -65,6 +64,8 @@ using namespace QQuickVisualTestUtil; Q_DECLARE_METATYPE(QQuickPathView::HighlightRangeMode) +#ifndef QT_NO_WIDGETS +#include <QStandardItemModel> static void initStandardTreeModel(QStandardItemModel *model) { QStandardItem *item; @@ -82,6 +83,7 @@ static void initStandardTreeModel(QStandardItemModel *model) item->setIcon(QIcon()); model->insertRow(2, item); } +#endif class tst_QQuickPathView : public QQmlDataTest @@ -120,7 +122,9 @@ private slots: void visualDataModel(); void undefinedPath(); void mouseDrag(); +#ifndef QT_NO_WIDGETS void treeModel(); +#endif void changePreferredHighlight(); void missingPercent(); void creationContext(); @@ -1415,6 +1419,7 @@ void tst_QQuickPathView::mouseDrag() delete canvas; } +#ifndef QT_NO_WIDGETS void tst_QQuickPathView::treeModel() { QQuickView *canvas = createView(); @@ -1442,6 +1447,7 @@ void tst_QQuickPathView::treeModel() delete canvas; } +#endif void tst_QQuickPathView::changePreferredHighlight() { diff --git a/tests/auto/quick/qquicksystempalette/qquicksystempalette.pro b/tests/auto/quick/qquicksystempalette/qquicksystempalette.pro index c8825c07fb..f422d26b44 100644 --- a/tests/auto/quick/qquicksystempalette/qquicksystempalette.pro +++ b/tests/auto/quick/qquicksystempalette/qquicksystempalette.pro @@ -5,4 +5,5 @@ macx:CONFIG -= app_bundle SOURCES += tst_qquicksystempalette.cpp CONFIG += parallel_test -QT += core-private gui-private qml-private quick-private widgets testlib +QT += core-private gui-private qml-private quick-private testlib +!contains(QT_CONFIG, no-widgets): QT += widgets diff --git a/tests/auto/quick/qquicksystempalette/tst_qquicksystempalette.cpp b/tests/auto/quick/qquicksystempalette/tst_qquicksystempalette.cpp index 3b74dfd0ed..6764128e7e 100644 --- a/tests/auto/quick/qquicksystempalette/tst_qquicksystempalette.cpp +++ b/tests/auto/quick/qquicksystempalette/tst_qquicksystempalette.cpp @@ -56,7 +56,9 @@ private slots: void activePalette(); void inactivePalette(); void disabledPalette(); +#ifndef QT_NO_WIDGETS void paletteChanged(); +#endif private: QQmlEngine engine; @@ -155,6 +157,7 @@ void tst_qquicksystempalette::disabledPalette() delete object; } +#ifndef QT_NO_WIDGETS void tst_qquicksystempalette::paletteChanged() { QString componentStr = "import QtQuick 2.0\nSystemPalette { }"; @@ -179,6 +182,7 @@ void tst_qquicksystempalette::paletteChanged() delete object; } +#endif QTEST_MAIN(tst_qquicksystempalette) diff --git a/tests/auto/quick/qquickvisualdatamodel/qquickvisualdatamodel.pro b/tests/auto/quick/qquickvisualdatamodel/qquickvisualdatamodel.pro index 4ae678181a..f5d72ff01b 100644 --- a/tests/auto/quick/qquickvisualdatamodel/qquickvisualdatamodel.pro +++ b/tests/auto/quick/qquickvisualdatamodel/qquickvisualdatamodel.pro @@ -11,4 +11,5 @@ TESTDATA = data/* CONFIG += parallel_test -QT += core-private gui-private v8-private qml-private quick-private widgets testlib +QT += core-private gui-private v8-private qml-private quick-private testlib +!contains(QT_CONFIG, no-widgets): QT += widgets diff --git a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp index 50c1e35b7e..82c8d44068 100644 --- a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp +++ b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp @@ -43,7 +43,6 @@ #include <qtest.h> #include <QtTest/QSignalSpy> -#include <QStandardItemModel> #include <QtQml/qqmlengine.h> #include <QtQml/qqmlcomponent.h> #include <QtQml/qqmlcontext.h> @@ -61,6 +60,8 @@ using namespace QQuickVisualTestUtil; template <typename T, int N> int lengthOf(const T (&)[N]) { return N; } +#ifndef QT_NO_WIDGETS +#include <QStandardItemModel> static void initStandardTreeModel(QStandardItemModel *model) { QStandardItem *item; @@ -78,6 +79,7 @@ static void initStandardTreeModel(QStandardItemModel *model) item->setIcon(QIcon()); model->insertRow(2, item); } +#endif class SingleRoleModel : public QAbstractListModel { @@ -120,6 +122,7 @@ protected: } }; +#ifndef QT_NO_WIDGETS class StandardItem : public QObject, public QStandardItem { Q_OBJECT @@ -143,6 +146,7 @@ public: static_cast<QStandardItemModel *>(property->object)->appendRow(item); } }; +#endif class DataObject : public QObject { @@ -183,9 +187,11 @@ private: }; QML_DECLARE_TYPE(SingleRoleModel) +QML_DECLARE_TYPE(DataObject) +#ifndef QT_NO_WIDGETS QML_DECLARE_TYPE(StandardItem) QML_DECLARE_TYPE(StandardItemModel) -QML_DECLARE_TYPE(DataObject) +#endif class tst_qquickvisualdatamodel : public QQmlDataTest { @@ -196,18 +202,20 @@ public: private slots: void initTestCase(); void cleanupTestCase(); +#ifndef QT_NO_WIDGETS void rootIndex(); void updateLayout_data(); void updateLayout(); void childChanged_data(); void childChanged(); - void objectListModel(); - void singleRole(); - void modelProperties(); void noDelegate_data(); void noDelegate(); void itemsDestroyed_data(); void itemsDestroyed(); +#endif + void objectListModel(); + void singleRole(); + void modelProperties(); void packagesDestroyed(); void qaimRowsMoved(); void qaimRowsMoved_data(); @@ -283,9 +291,11 @@ void tst_qquickvisualdatamodel::initTestCase() qRegisterMetaType<QQuickChangeSet>(); qmlRegisterType<SingleRoleModel>("tst_qquickvisualdatamodel", 1, 0, "SingleRoleModel"); + qmlRegisterType<DataObject>("tst_qquickvisualdatamodel", 1, 0, "DataObject"); +#ifndef QT_NO_WIDGETS qmlRegisterType<StandardItem>("tst_qquickvisualdatamodel", 1, 0, "StandardItem"); qmlRegisterType<StandardItemModel>("tst_qquickvisualdatamodel", 1, 0, "StandardItemModel"); - qmlRegisterType<DataObject>("tst_qquickvisualdatamodel", 1, 0, "DataObject"); +#endif } void tst_qquickvisualdatamodel::cleanupTestCase() @@ -296,6 +306,7 @@ tst_qquickvisualdatamodel::tst_qquickvisualdatamodel() { } +#ifndef QT_NO_WIDGETS void tst_qquickvisualdatamodel::rootIndex() { QQmlEngine engine; @@ -437,6 +448,7 @@ void tst_qquickvisualdatamodel::childChanged() QVERIFY(name); QCOMPARE(name->text(), QString("Row 3 Item")); } +#endif void tst_qquickvisualdatamodel::objectListModel() { @@ -603,6 +615,7 @@ void tst_qquickvisualdatamodel::modelProperties() QCOMPARE(delegate->property("test8").toInt(),1); } +#ifndef QT_NO_WIDGETS { QQuickView view; @@ -644,10 +657,11 @@ 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<QUrl>("source"); @@ -711,6 +725,7 @@ void tst_qquickvisualdatamodel::itemsDestroyed() QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); QVERIFY(!delegate); } +#endif void tst_qquickvisualdatamodel::packagesDestroyed() { @@ -2368,7 +2383,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] @@ -2449,7 +2464,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] @@ -2949,6 +2964,7 @@ 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] @@ -2973,7 +2989,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] diff --git a/tests/auto/quick/quick.pro b/tests/auto/quick/quick.pro index b018fbf14a..1c73a3b7d6 100644 --- a/tests/auto/quick/quick.pro +++ b/tests/auto/quick/quick.pro @@ -2,10 +2,11 @@ TEMPLATE = subdirs PUBLICTESTS += \ geometry \ - nodes \ rendernode \ qquickpixmapcache +!contains(QT_CONFIG, no-widgets): PUBLICTESTS += nodes + !cross_compile: PUBLICTESTS += examples # This test requires the qtconcurrent module |