path: root/src/widgets/styles/qwindowsxpstyle_p_p.h
diff options
authorFriedemann Kleint <>2016-04-01 09:25:45 +0200
committerFriedemann Kleint <>2016-04-18 13:57:43 +0000
commitf1e0eedcf501936e6b4f77b6fe3ac4997d757d94 (patch)
treed6a007a0fca5e46272643e152d6541f7dbb7fbf2 /src/widgets/styles/qwindowsxpstyle_p_p.h
parent4d10e55d4d666f5557a51d43a1bd4b1f172829ac (diff)
QWindowsXP/VistaStyle: Move the Vista treeview handling to QWindowsXPStylePrivate.
QWindowsXPStylePrivate maintains a list of theme handles for various style items. The derived class QWindowsVistaStylePrivate had logic to use a special helper window with the "explorer" window theme set to obtain the correct treeview arrow branch indicator (arrow shape for Vista as opposed to '+'/'-' on Windows XP) when creating the "TREEVIEW" theme. This required calling the helper function QWindowsVistaStylePrivate::initTreeViewTheming() before QWindowsXPStylePrivate::createTheme(), which is prone to errors and initialization order issues. This could be solved by making QWindowsXPStylePrivate::createTheme() virtual or similar, but since it the fate of QWindowsXPStylePrivate is most likely to be merged into QWindowsVistaStylePrivate; it was decided to move the entire special handling of the Vista treeviews into QWindowsXPStylePrivate. The existing enumeration value QWindowsXPStylePrivate::TreeViewTheme is renamed to QWindowsXPStylePrivate::XpTreeViewTheme and a new value QWindowsXPStylePrivate::VistaTreeViewTheme is added for which QWindowsXPStylePrivate::createTheme() invokes the special handling. This also removes the need to destroy the helper window in unpolish(), which should save some initializations. Task-number: QTBUG-52230 Change-Id: I0492ecf38fb3e5eabc4ecbdef70f0bf05e82e104 Reviewed-by: Adam Light <> Reviewed-by: Joerg Bornemann <>
Diffstat (limited to 'src/widgets/styles/qwindowsxpstyle_p_p.h')
1 files changed, 6 insertions, 1 deletions
diff --git a/src/widgets/styles/qwindowsxpstyle_p_p.h b/src/widgets/styles/qwindowsxpstyle_p_p.h
index d75c064369..51541ed218 100644
--- a/src/widgets/styles/qwindowsxpstyle_p_p.h
+++ b/src/widgets/styles/qwindowsxpstyle_p_p.h
@@ -350,9 +350,10 @@ public:
- TreeViewTheme,
+ XpTreeViewTheme, // '+'/'-' shape treeview indicators (XP)
+ VistaTreeViewTheme, // arrow shape treeview indicators (Vista) obtained from "explorer" theme.
@@ -413,6 +414,9 @@ private:
void showProperties(XPThemeData &themeData);
+ static bool initVistaTreeViewTheming();
+ static void cleanupVistaTreeViewTheming();
static QBasicAtomicInt ref;
static bool use_xp;
static QPixmap *tabbody;
@@ -424,6 +428,7 @@ private:
uchar *bufferPixels;
int bufferW, bufferH;
+ static HWND m_vistaTreeViewHelper;
static HTHEME m_themes[NThemes];