summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorFabian Bumberger <fbumberger@rim.com>2014-02-28 21:05:15 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-08 11:45:39 +0100
commit79469565cfcd1397110be7b5c61466624a92153d (patch)
tree33f2bbf067daa4eaadfaed1839270a44427ae274 /src/gui
parent43af92be45b5ea59c7db71b977faf5870a0baa24 (diff)
Fix description of how themes are created (code comments)
Change-Id: I3b8ed0af5208687a9ab75e916b477f5e24b4d1e2 Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qguiapplication.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index c587e51299..1347f309e5 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1007,16 +1007,17 @@ static void init_platform(const QString &pluginArgument, const QString &platform
if (!platformThemeName.isEmpty())
themeNames.append(platformThemeName);
- // 2) Ask the platform integration for a list of names and try loading them.
+ // 2) Ask the platform integration for a list of theme names
themeNames += QGuiApplicationPrivate::platform_integration->themeNames();
+ // 3) Look for a theme plugin.
foreach (const QString &themeName, themeNames) {
QGuiApplicationPrivate::platform_theme = QPlatformThemeFactory::create(themeName, platformPluginPath);
if (QGuiApplicationPrivate::platform_theme)
break;
}
- // 3) If none found, look for a theme plugin. Theme plugins are located in the
- // same directory as platform plugins.
+ // 4) If no theme plugin was found ask the platform integration to
+ // create a theme
if (!QGuiApplicationPrivate::platform_theme) {
foreach (const QString &themeName, themeNames) {
QGuiApplicationPrivate::platform_theme = QGuiApplicationPrivate::platform_integration->createPlatformTheme(themeName);
@@ -1026,7 +1027,7 @@ static void init_platform(const QString &pluginArgument, const QString &platform
// No error message; not having a theme plugin is allowed.
}
- // 4) Fall back on the built-in "null" platform theme.
+ // 5) Fall back on the built-in "null" platform theme.
if (!QGuiApplicationPrivate::platform_theme)
QGuiApplicationPrivate::platform_theme = new QPlatformTheme;