{
QWindowsXPStyle::unpolish(widget);
- QWindowsVistaStylePrivate *d = const_cast<QWindowsVistaStylePrivate*>(d_func());
+ QWindowsVistaStylePrivate *d = d_func();
+ // Delete the tree view helper in case the XP style cleaned the
+ // theme handle map due to a theme or QStyle change (QProxyStyle).
+ if (!QWindowsXPStylePrivate::hasTheme(QWindowsXPStylePrivate::TreeViewTheme))
+ d->cleanupTreeViewTheming();
+
d->stopAnimation(widget);
#ifndef QT_NO_LINEEDIT
QWindowsVistaStylePrivate::~QWindowsVistaStylePrivate()
{
qDeleteAll(animations);
- if (m_treeViewHelper)
- DestroyWindow(m_treeViewHelper);
+ cleanupTreeViewTheming();
}
void QWindowsVistaStylePrivate::timerEvent()
return QWindowsXPStylePrivate::createTheme(QWindowsXPStylePrivate::TreeViewTheme, m_treeViewHelper);
}
+void QWindowsVistaStylePrivate::cleanupTreeViewTheming()
+{
+ if (m_treeViewHelper) {
+ DestroyWindow(m_treeViewHelper);
+ m_treeViewHelper = 0;
+ }
+}
+
/*!
\internal
*/
static HTHEME createTheme(int theme, HWND hwnd);
static QString themeName(int theme);
+ static inline bool hasTheme(int theme) { return theme >= 0 && theme < NThemes && m_themes[theme]; }
QIcon dockFloat, dockClose;