summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs/qwizard_win.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/dialogs/qwizard_win.cpp')
-rw-r--r--src/widgets/dialogs/qwizard_win.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp
index 4a4f109a82c..7f90efa190b 100644
--- a/src/widgets/dialogs/qwizard_win.cpp
+++ b/src/widgets/dialogs/qwizard_win.cpp
@@ -166,6 +166,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;
@@ -247,6 +248,7 @@ QVistaHelper::QVistaHelper(QWizard *wizard)
, wizard(wizard)
, backButton_(0)
{
+ ++instanceCount;
is_vista = resolveSymbols();
if (is_vista)
backButton_ = new QVistaBackButton(wizard);
@@ -259,6 +261,7 @@ QVistaHelper::QVistaHelper(QWizard *wizard)
QVistaHelper::~QVistaHelper()
{
+ --instanceCount;
}
bool QVistaHelper::isCompositionEnabled()
@@ -281,7 +284,7 @@ bool QVistaHelper::isThemeActive()
QVistaHelper::VistaState QVistaHelper::vistaState()
{
- if (cachedVistaState == Dirty)
+ if (instanceCount == 0 || cachedVistaState == Dirty)
cachedVistaState =
isCompositionEnabled() ? VistaAero : isThemeActive() ? VistaBasic : Classic;
return cachedVistaState;