aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlimport_p.h
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2013-08-13 14:16:26 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-11 14:00:21 +0200
commita9cf828559b00bc70f59250b7f3cf38458774715 (patch)
tree000f8c2528e05a44f1a2049c3a4df6f8c6a6509c /src/qml/qml/qqmlimport_p.h
parentbb9eb695003d786d86ff7ab44be51bb8cdca2573 (diff)
Support statically linked module plugins
Up til now, QQmlImports would always assume module plugins are dynamically linked, and as such, go looking for them on the file system. This would fail for plugins linked in statically. This patch will hook into QQmlImports at the place where it iterates through all plugins in a qmldir and try to load them dynamically. If some plugins cannot be resolved, we now do an extra interation over static plugins to check if any of them has the correct uri specified in their metadata. Hooking into the loading process this late, will ensure that as much code as possible is shared between dynamic and static plugin loading so that setting up base urls, namespaces and guards will remain the same. Note: this patch is one out of several patches that is needed to build QML2 apps statically, and depends on plugins reporting their URI through the plugin meta data system. This will be injected automatically by qmake+moc. Task-number: QTBUG-28357 Change-Id: If9a204e942ca7003448e188a1a47eec69b34c37b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlimport_p.h')
-rw-r--r--src/qml/qml/qqmlimport_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlimport_p.h b/src/qml/qml/qqmlimport_p.h
index 2c3d4a7bca..f19f5d4f34 100644
--- a/src/qml/qml/qqmlimport_p.h
+++ b/src/qml/qml/qqmlimport_p.h
@@ -132,6 +132,7 @@ public:
static QString completeQmldirPath(const QString &uri, const QString &base, int vmaj, int vmin,
QQmlImports::ImportVersion version);
+ static QString versionString(int vmaj, int vmin, ImportVersion version);
static bool isLocal(const QString &url);
static bool isLocal(const QUrl &url);
@@ -169,6 +170,8 @@ private:
QString resolvePlugin(QQmlTypeLoader *typeLoader,
const QString &qmldirPath, const QString &qmldirPluginPath,
const QString &baseName);
+ bool importPlugin(QObject *instance, const QString &basePath, const QString &uri,
+ const QString &typeNamespace, bool initEngine, QList<QQmlError> *errors);
struct QmldirCache {
int versionMajor;