From f7957f39937c42aadecc6ad2b73d006559514e00 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 14 Mar 2012 13:50:14 +0100 Subject: Refactor theme plugin loading. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the old implementation, the QPlatformIntegration was asked for the theme first, so there was no way of overriding that by a custom plugin. Also, there was a memory leak in case the platform theme was actually created by a plugin. QGuiApplication now asks the QPlatformIntegration for a list of potential theme names first, tries to load them using the plugin loader and finally invokes a factory method of QPlatformIntegration in case that fails. The theme is now owned by QGuiApplication. In the XCB plugin, the environment variable DESKTOP_SESSION is queried and appended to the list of themes, making it possible to load plugins for other session types. Change-Id: I1a4b4e061815bca16c65b23e591bb7563a3e44e2 Reviewed-by: Samuel Rødal --- src/plugins/platforms/windows/qwindowstheme.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/windows/qwindowstheme.h') diff --git a/src/plugins/platforms/windows/qwindowstheme.h b/src/plugins/platforms/windows/qwindowstheme.h index 37346eed3a..7515a13a72 100644 --- a/src/plugins/platforms/windows/qwindowstheme.h +++ b/src/plugins/platforms/windows/qwindowstheme.h @@ -57,7 +57,7 @@ public: QWindowsTheme(); ~QWindowsTheme(); - static QWindowsTheme *instance(); + static QWindowsTheme *instance() { return m_instance; } virtual bool usePlatformNativeDialog(DialogType type) const; virtual QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const; @@ -69,6 +69,8 @@ public: void windowsThemeChanged(QWindow *window); + static const char *name; + private: void refresh() { refreshPalettes(); refreshFonts(); } void clearPalettes(); @@ -76,6 +78,7 @@ private: void clearFonts(); void refreshFonts(); + static QWindowsTheme *m_instance; QPalette *m_palettes[NPalettes]; QFont *m_fonts[NFonts]; }; -- cgit v1.2.3