QFactoryLoader: load extraSearchPath first

Since `QT_QPA_PLATFORM_PLUGIN_PATH` or `-platformpluginpath`
 specifies the path to platform plugins, `extraSearchPath`
 should be loaded first.

Change-Id: I2e62fbf2021250ca864c669a7bbd7d56acd67d1e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 457580936ddebc73e8a24fc8af0d342084b3a0b5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b6108318c2a7e79c297e6fa7cdc9f6de88b6efa9)
This commit is contained in:
Mike Chen 2024-12-19 17:25:17 +08:00 committed by Qt Cherry-pick Bot
parent b2dcce10a2
commit b0d788f7a9

View File

@ -394,6 +394,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
@ -401,11 +404,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