From 457580936ddebc73e8a24fc8af0d342084b3a0b5 Mon Sep 17 00:00:00 2001 From: Mike Chen Date: Thu, 19 Dec 2024 17:25:17 +0800 Subject: [PATCH] QFactoryLoader: load extraSearchPath first Since `QT_QPA_PLATFORM_PLUGIN_PATH` or `-platformpluginpath` specifies the path to platform plugins, `extraSearchPath` should be loaded first. Pick-to: 6.8 6.9 Change-Id: I2e62fbf2021250ca864c669a7bbd7d56acd67d1e Reviewed-by: Thiago Macieira --- src/corelib/plugin/qfactoryloader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index 5abd6ff719e..1c6ebdaea39 100644 --- a/src/corelib/plugin/qfactoryloader.cpp +++ b/src/corelib/plugin/qfactoryloader.cpp @@ -398,6 +398,9 @@ void QFactoryLoader::update() #ifdef QT_SHARED Q_D(QFactoryLoader); + if (!d->extraSearchPath.isEmpty()) + d->updateSinglePath(d->extraSearchPath); + const QStringList paths = QCoreApplication::libraryPaths(); for (const QString &pluginDir : paths) { #ifdef Q_OS_ANDROID @@ -405,11 +408,8 @@ void QFactoryLoader::update() #else QString path = pluginDir + d->suffix; #endif - d->updateSinglePath(path); } - if (!d->extraSearchPath.isEmpty()) - d->updateSinglePath(d->extraSearchPath); #else Q_D(QFactoryLoader); qCDebug(lcFactoryLoader) << "ignoring" << d->iid