summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/dialogs')
-rw-r--r--src/widgets/dialogs/qwizard_win.cpp5
-rw-r--r--src/widgets/dialogs/qwizard_win_p.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp
index 4a4f109a82..7f90efa190 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;
diff --git a/src/widgets/dialogs/qwizard_win_p.h b/src/widgets/dialogs/qwizard_win_p.h
index 80b5fd8241..86696952b0 100644
--- a/src/widgets/dialogs/qwizard_win_p.h
+++ b/src/widgets/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();