diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp index cdae746ba19..498ecac2cd4 100644 --- a/src/gui/kernel/qplatformtheme.cpp +++ b/src/gui/kernel/qplatformtheme.cpp @@ -850,6 +850,11 @@ unsigned QPlatformThemePrivate::currentKeyPlatforms() return result; } +QString QPlatformTheme::name() const +{ + return d_func()->name; +} + QT_END_NAMESPACE #include "moc_qplatformtheme.cpp" diff --git a/src/gui/kernel/qplatformtheme.h b/src/gui/kernel/qplatformtheme.h index 326b69c1e73..e883cfebdea 100644 --- a/src/gui/kernel/qplatformtheme.h +++ b/src/gui/kernel/qplatformtheme.h @@ -317,10 +317,14 @@ public: static QVariant defaultThemeHint(ThemeHint hint); static QString defaultStandardButtonText(int button); static QString removeMnemonics(const QString &original); + QString name() const; protected: explicit QPlatformTheme(QPlatformThemePrivate *priv); QScopedPointer d_ptr; + +private: + friend class QPlatformThemeFactory; }; QT_END_NAMESPACE diff --git a/src/gui/kernel/qplatformtheme_p.h b/src/gui/kernel/qplatformtheme_p.h index bdf8a34e19a..e847ead3be5 100644 --- a/src/gui/kernel/qplatformtheme_p.h +++ b/src/gui/kernel/qplatformtheme_p.h @@ -41,6 +41,8 @@ public: static unsigned currentKeyPlatforms(); QPalette *systemPalette; + + QString name; }; QT_END_NAMESPACE diff --git a/src/gui/kernel/qplatformthemefactory.cpp b/src/gui/kernel/qplatformthemefactory.cpp index a66ad0f8804..3d2c1701989 100644 --- a/src/gui/kernel/qplatformthemefactory.cpp +++ b/src/gui/kernel/qplatformthemefactory.cpp @@ -8,6 +8,8 @@ #include "qmutex.h" #include "qguiapplication.h" +#include "qplatformtheme.h" +#include "qplatformtheme_p.h" #include "qdebug.h" QT_BEGIN_NAMESPACE @@ -22,7 +24,10 @@ QPlatformTheme *QPlatformThemeFactory::create(const QString& key, const QString QStringList paramList = key.split(u':'); const QString platform = paramList.takeFirst().toLower(); loader->setExtraSearchPath(platformPluginPath); - return qLoadPlugin(loader(), platform, paramList); + QPlatformTheme *theme = qLoadPlugin(loader(), platform, paramList); + if (theme) + theme->d_func()->name = key; + return theme; } /*!