diff options
Diffstat (limited to 'src/widgets/styles/qwindowsvistastyle.cpp')
-rw-r--r-- | src/widgets/styles/qwindowsvistastyle.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp index 138f5dbf17..6fce426dd3 100644 --- a/src/widgets/styles/qwindowsvistastyle.cpp +++ b/src/widgets/styles/qwindowsvistastyle.cpp @@ -2469,7 +2469,12 @@ void QWindowsVistaStyle::unpolish(QWidget *widget) { 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 @@ -2542,8 +2547,7 @@ QWindowsVistaStylePrivate::QWindowsVistaStylePrivate() : QWindowsVistaStylePrivate::~QWindowsVistaStylePrivate() { qDeleteAll(animations); - if (m_treeViewHelper) - DestroyWindow(m_treeViewHelper); + cleanupTreeViewTheming(); } void QWindowsVistaStylePrivate::timerEvent() @@ -2694,6 +2698,14 @@ bool QWindowsVistaStylePrivate::initTreeViewTheming() return QWindowsXPStylePrivate::createTheme(QWindowsXPStylePrivate::TreeViewTheme, m_treeViewHelper); } +void QWindowsVistaStylePrivate::cleanupTreeViewTheming() +{ + if (m_treeViewHelper) { + DestroyWindow(m_treeViewHelper); + m_treeViewHelper = 0; + } +} + /*! \internal */ |