diff options
-rw-r--r-- | src/gui/dialogs/qwizard_win.cpp | 5 | ||||
-rw-r--r-- | src/gui/dialogs/qwizard_win_p.h | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/dialogs/qwizard_win.cpp b/src/gui/dialogs/qwizard_win.cpp index 974290a60b..bd4301a2aa 100644 --- a/src/gui/dialogs/qwizard_win.cpp +++ b/src/gui/dialogs/qwizard_win.cpp @@ -164,6 +164,7 @@ static PtrDrawThemeBackground pDrawThemeBackground = 0; static PtrGetThemePartSize pGetThemePartSize = 0; static PtrGetThemeColor pGetThemeColor = 0; +int QVistaHelper::instanceCount = 0; bool QVistaHelper::is_vista = false; QVistaHelper::VistaState QVistaHelper::cachedVistaState = QVistaHelper::Dirty; @@ -243,6 +244,7 @@ QVistaHelper::QVistaHelper(QWizard *wizard) , wizard(wizard) , backButton_(0) { + ++instanceCount; is_vista = resolveSymbols(); if (is_vista) backButton_ = new QVistaBackButton(wizard); @@ -255,6 +257,7 @@ QVistaHelper::QVistaHelper(QWizard *wizard) QVistaHelper::~QVistaHelper() { + --instanceCount; } bool QVistaHelper::isCompositionEnabled() @@ -277,7 +280,7 @@ bool QVistaHelper::isThemeActive() QVistaHelper::VistaState QVistaHelper::vistaState() { - if (cachedVistaState == Dirty) + if (instanceCount == 0 || cachedVistaState == Dirty) cachedVistaState = isCompositionEnabled() ? VistaAero : isThemeActive() ? VistaBasic : Classic; return cachedVistaState; diff --git a/src/gui/dialogs/qwizard_win_p.h b/src/gui/dialogs/qwizard_win_p.h index ee424cc194..1db3bbaa1a 100644 --- a/src/gui/dialogs/qwizard_win_p.h +++ b/src/gui/dialogs/qwizard_win_p.h @@ -133,6 +133,7 @@ private: void mouseReleaseEvent(QMouseEvent *event); bool eventFilter(QObject *obj, QEvent *event); + static int instanceCount; static bool is_vista; static VistaState cachedVistaState; static bool isCompositionEnabled(); |