From 709f6370884b110def2e4665df8fa7bbf5fae734 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 13 May 2016 14:24:59 +0200 Subject: Re-apply the cast part of commit 392c7b99348e2a96ef11adb5712095fbd13fb780 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: J-P Nurmi --- src/qml/qml/qqmlimport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml/qml/qqmlimport.cpp') 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 &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(plugin.instance())) + if (plugin.metaData().value(QStringLiteral("IID")).toString() == QLatin1String(QQmlExtensionInterface_iid)) plugins.append(plugin); } } -- cgit v1.2.3