From 79469565cfcd1397110be7b5c61466624a92153d Mon Sep 17 00:00:00 2001 From: Fabian Bumberger Date: Fri, 28 Feb 2014 21:05:15 +0100 Subject: [PATCH] Fix description of how themes are created (code comments) Change-Id: I3b8ed0af5208687a9ab75e916b477f5e24b4d1e2 Reviewed-by: Kevin Krammer Reviewed-by: Rafael Roquetto --- src/gui/kernel/qguiapplication.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index c587e51299d..1347f309e57 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;