diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2014-03-31 16:29:06 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@digia.com> | 2014-03-31 18:08:48 +0200 |
commit | e6b42646fd477daf31caf52ead3f9452f340c114 (patch) | |
tree | e61714fcbc9b1a08893fc904628f47103ea1bb27 | |
parent | c6b93561618776bc247483e55db98df590ec0c8d (diff) |
Make "Qt.declarative" available as "Qt.quick" again for Qt 4.
This was accidentally removed when switching to the new Qt modules
approach.
Change-Id: Ie8db5a183c2cc3a82d31c2793710983cf4206ef0
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
-rw-r--r-- | src/lib/qtprofilesetup/qtprofilesetup.cpp | 8 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata/qml-debugging/main.cpp | 22 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.cpp | 2 |
3 files changed, 27 insertions, 5 deletions
diff --git a/src/lib/qtprofilesetup/qtprofilesetup.cpp b/src/lib/qtprofilesetup/qtprofilesetup.cpp index c9000947a..da892a739 100644 --- a/src/lib/qtprofilesetup/qtprofilesetup.cpp +++ b/src/lib/qtprofilesetup/qtprofilesetup.cpp @@ -209,6 +209,9 @@ static void createModules(Profile &profile, Settings *settings, virtualModule.qbsName = QLatin1String("widgets"); virtualModule.dependencies = QStringList() << QLatin1String("core") << QLatin1String("gui"); modules << virtualModule; + virtualModule.qbsName = QLatin1String("quick"); + virtualModule.dependencies = QStringList() << QLatin1String("declarative"); + modules << virtualModule; virtualModule.qbsName = QLatin1String("concurrent"); virtualModule.dependencies = QStringList() << QLatin1String("core"); modules << virtualModule; @@ -306,9 +309,12 @@ static void createModules(Profile &profile, Settings *settings, QByteArray propertiesString; if (module.qbsName == QLatin1String("declarative") || module.qbsName == QLatin1String("quick")) { + const QByteArray debugMacro = module.qbsName == QLatin1String("declarative") + || qtEnvironment.qtMajorVersion < 5 + ? "QT_DECLARATIVE_DEBUG" : "QT_QML_DEBUG"; propertiesString = "property bool qmlDebugging: false\n" " cpp.defines: " - "qmlDebugging ? base.concat('QT_QML_DEBUG') : base"; + "qmlDebugging ? base.concat('" + debugMacro + "') : base"; } content.replace("### special properties", propertiesString); moduleFile.resize(0); diff --git a/tests/auto/blackbox/testdata/qml-debugging/main.cpp b/tests/auto/blackbox/testdata/qml-debugging/main.cpp index 51f46ef65..e28c5e126 100644 --- a/tests/auto/blackbox/testdata/qml-debugging/main.cpp +++ b/tests/auto/blackbox/testdata/qml-debugging/main.cpp @@ -1,12 +1,28 @@ +#include <QtGlobal> +#include <QString> + +#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) #include <QGuiApplication> #include <QQmlApplicationEngine> +typedef QGuiApplication Application; +#define AH_SO_THIS_IS_QT5 +#else +#include <QApplication> +#include <QDeclarativeView> +#define AH_SO_THIS_IS_QT4 +typedef QApplication Application; +#endif int main(int argc, char *argv[]) { - QGuiApplication app(argc, argv); - + Application app(argc, argv); +#ifdef AH_SO_THIS_IS_QT5 QQmlApplicationEngine engine; - engine.load(QUrl(QStringLiteral("qrc:///qml/main.qml"))); + engine.load(QUrl("blubb")); +#else + QDeclarativeView view; + view.setSource(QUrl("blubb")); +#endif return app.exec(); } diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 821438cb9..c08054877 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -1698,7 +1698,7 @@ void TestBlackbox::qmlDebugging() QVERIFY2(nm.waitForFinished(), qPrintable(nm.errorString())); QVERIFY2(nm.exitCode() == 0, nm.readAllStandardError().constData()); const QByteArray output = nm.readAllStandardOutput(); - QVERIFY2(output.contains("qQmlEnableDebuggingHelper"), output.constData()); + QVERIFY2(output.toLower().contains("debugginghelper"), output.constData()); } } |