summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2011-12-08 09:52:01 +0100
committerQt by Nokia <qt-info@nokia.com>2011-12-09 11:47:09 +0100
commit86ca326d9f0462d4c6a46ac76af586572588314c (patch)
treecfda6154647a76db712d5a51fa004e8289712b4a /tools
parent5603019ea26d036f65e66ba290e7414121acd008 (diff)
qmlplugindump: Don't depend on qtquick1 and widgets.
Change-Id: I38baaf2d8d02c3f35d2dece9fc580c6e1fee872d Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/qmlplugindump/main.cpp29
-rw-r--r--tools/qmlplugindump/qmlplugindump.pro3
2 files changed, 28 insertions, 4 deletions
diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp
index 79c6fce3dd..54b3d9438f 100644
--- a/tools/qmlplugindump/main.cpp
+++ b/tools/qmlplugindump/main.cpp
@@ -45,8 +45,11 @@
#include <QtQuick/private/qquickevents_p_p.h>
#include <QtQuick/private/qquickpincharea_p.h>
+#ifdef QT_WIDGETS_LIB
#include <QtWidgets/QApplication>
+#endif
+#include <QtGui/QGuiApplication>
#include <QtCore/QDir>
#include <QtCore/QFileInfo>
#include <QtCore/QSet>
@@ -607,7 +610,12 @@ int main(int argc, char *argv[])
// Running this application would bring up the Qt Simulator (since it links QtGui), avoid that!
QtSimulatorPrivate::SimulatorConnection::createStubInstance();
#endif
+
+#ifdef QT_WIDGETS_LIB
QApplication app(argc, argv);
+#else
+ QGuiApplication app(argc, argv);
+#endif
const QStringList args = app.arguments();
const QString appName = QFileInfo(app.applicationFilePath()).baseName();
if (args.size() < 2) {
@@ -679,11 +687,26 @@ int main(int argc, char *argv[])
engine.addImportPath(pluginImportPath);
}
- // load the QtQuick 1 & 2 plugins
+#ifdef QT_WIDGETS_LIB
+ // load the QtQuick 1 plugin
+ {
+ QByteArray code("import QtQuick 1.0\nQtObject {}");
+ QDeclarativeComponent c(&engine);
+ c.setData(code, QUrl::fromLocalFile(pluginImportPath + "/loadqtquick1.qml"));
+ c.create();
+ if (!c.errors().isEmpty()) {
+ foreach (const QDeclarativeError &error, c.errors())
+ qWarning() << error.toString();
+ return EXIT_IMPORTERROR;
+ }
+ }
+#endif
+
+ // load the QtQuick 2 plugin
{
- QByteArray code("import QtQuick 1.0 as Q1\nimport QtQuick 2.0 as Q2\nQ2.QtObject {}");
+ QByteArray code("import QtQuick 2.0\nQtObject {}");
QDeclarativeComponent c(&engine);
- c.setData(code, QUrl::fromLocalFile(pluginImportPath + "/loadqtquick.qml"));
+ c.setData(code, QUrl::fromLocalFile(pluginImportPath + "/loadqtquick2.qml"));
c.create();
if (!c.errors().isEmpty()) {
foreach (const QDeclarativeError &error, c.errors())
diff --git a/tools/qmlplugindump/qmlplugindump.pro b/tools/qmlplugindump/qmlplugindump.pro
index a327bb68d9..25c0037129 100644
--- a/tools/qmlplugindump/qmlplugindump.pro
+++ b/tools/qmlplugindump/qmlplugindump.pro
@@ -2,7 +2,8 @@ TEMPLATE = app
CONFIG += qt uic console
DESTDIR = $$QT.declarative.bins
-QT += declarative declarative-private quick-private qtquick1 core-private widgets
+QT += declarative declarative-private quick-private core-private
+!isEmpty(QT.widgets.name):!isEmpty(QT.qtquick1.name): QT += widgets qtquick1
TARGET = qmlplugindump