diff options
Diffstat (limited to 'src/gui/kernel/qplatformthemefactory.cpp')
-rw-r--r-- | src/gui/kernel/qplatformthemefactory.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gui/kernel/qplatformthemefactory.cpp b/src/gui/kernel/qplatformthemefactory.cpp index a66ad0f880..beefa1c294 100644 --- a/src/gui/kernel/qplatformthemefactory.cpp +++ b/src/gui/kernel/qplatformthemefactory.cpp @@ -8,21 +8,26 @@ #include "qmutex.h" #include "qguiapplication.h" +#include "qplatformtheme.h" +#include "qplatformtheme_p.h" #include "qdebug.h" QT_BEGIN_NAMESPACE using namespace Qt::StringLiterals; -Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, +Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, ptLoader, (QPlatformThemeFactoryInterface_iid, "/platformthemes"_L1, Qt::CaseInsensitive)) QPlatformTheme *QPlatformThemeFactory::create(const QString& key, const QString &platformPluginPath) { QStringList paramList = key.split(u':'); const QString platform = paramList.takeFirst().toLower(); - loader->setExtraSearchPath(platformPluginPath); - return qLoadPlugin<QPlatformTheme, QPlatformThemePlugin>(loader(), platform, paramList); + ptLoader->setExtraSearchPath(platformPluginPath); + QPlatformTheme *theme = qLoadPlugin<QPlatformTheme, QPlatformThemePlugin>(ptLoader(), platform, paramList); + if (theme) + theme->d_func()->name = key; + return theme; } /*! @@ -33,8 +38,8 @@ QPlatformTheme *QPlatformThemeFactory::create(const QString& key, const QString */ QStringList QPlatformThemeFactory::keys(const QString &platformPluginPath) { - loader->setExtraSearchPath(platformPluginPath); - return loader->keyMap().values(); + ptLoader->setExtraSearchPath(platformPluginPath); + return ptLoader->keyMap().values(); } QT_END_NAMESPACE |