qmlplugindump: Load QtQuick 1 plugin.
authorChristian Kamm <christian.d.kamm@nokia.com>
Fri, 26 Aug 2011 08:47:13 +0000 (10:47 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 29 Aug 2011 06:26:23 +0000 (08:26 +0200)
This allows the QtQuick1 types to be dumped with --builtin and to be
skipped when dumping other plugins that use them.

Change-Id: I23ecba5cea7c11e998861746f1c7056e8911abf3
Reviewed-on: http://codereview.qt.nokia.com/3650
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
tools/qmlplugindump/main.cpp
tools/qmlplugindump/qmlplugindump.pro

index 46d3173..1fdfb2e 100644 (file)
@@ -540,6 +540,19 @@ int main(int argc, char *argv[])
         engine.addImportPath(pluginImportPath);
     }
 
+    // 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;
+        }
+    }
+
     // find all QMetaObjects reachable from the builtin module
     QSet<const QMetaObject *> defaultReachable = collectReachableMetaObjects();
     QList<QDeclarativeType *> defaultTypes = QDeclarativeMetaType::qmlTypes();
index 0ac3a70..49134a0 100644 (file)
@@ -2,7 +2,7 @@ TEMPLATE = app
 CONFIG += qt uic console
 DESTDIR = $$QT.declarative.bins
 
-QT += declarative declarative-private core-private
+QT += declarative declarative-private qtquick1 core-private
 
 TARGET = qmlplugindump