aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlimport.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2016-05-13 14:24:59 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2016-05-17 12:57:48 +0000
commit709f6370884b110def2e4665df8fa7bbf5fae734 (patch)
treeff96ec143a51bf12cc7cb7f71b7202f04b9cbfc7 /src/qml/qml/qqmlimport.cpp
parent27567f7c4cb9c74c2ad3829f716caf8c5095b16b (diff)
Re-apply the cast part of commit 392c7b99348e2a96ef11adb5712095fbd13fb780
We reverted this in 6f59c91c51edd7207635c3fa2f0b2b1179e7aa6e to avoid further breakage in a patch release. Now let's do the right thing in the next minor release and replace the qobject_cast on the instance with the IID check that won't require instantiating the plugin in the qml loader thread. [ChangeLog][QtQml][Important Behavior Changes] When the engine looks for QML modules / extension plugins in statically linked applications, the plugins are not instantiated in the qml loader thread anymore. For this to work however it is necessary for plugins to use Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) in their class declaration instead of hardcoding the interface id as a string literal. Task-number: QTBUG-52012 Change-Id: I45fe8b9fec23b3d0408b7ee79ce297c7d47ce36d Reviewed-by: Sebastian Lösch <Sebastian.Loesch@governikus.com> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlimport.cpp')
-rw-r--r--src/qml/qml/qqmlimport.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index 8a7fa369e6..5ed2ad6bf1 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -893,7 +893,7 @@ bool QQmlImportsPrivate::populatePluginPairVector(QVector<StaticPluginPair> &res
// To avoid traversing all static plugins for all imports, we cut down
// the list the first time called to only contain QML plugins:
foreach (const QStaticPlugin &plugin, QPluginLoader::staticPlugins()) {
- if (qobject_cast<QQmlExtensionPlugin *>(plugin.instance()))
+ if (plugin.metaData().value(QStringLiteral("IID")).toString() == QLatin1String(QQmlExtensionInterface_iid))
plugins.append(plugin);
}
}