summaryrefslogtreecommitdiffstats
path: root/src/gui/dialogs/qwizard_win.cpp
diff options
context:
space:
mode:
authorjasplin <qt-info@nokia.com>2009-05-18 12:30:09 (GMT)
committerjasplin <qt-info@nokia.com>2009-05-18 12:37:27 (GMT)
commit0ff3bb25df3626a8112def75fc3ff048c70ebdb2 (patch)
tree3361fa90b167400547fd50b87ac502272c15e02b /src/gui/dialogs/qwizard_win.cpp
parent7008bfe80e0466ed2978b39e7e698bbd52fb690f (diff)
downloadQt-0ff3bb25df3626a8112def75fc3ff048c70ebdb2.zip
Qt-0ff3bb25df3626a8112def75fc3ff048c70ebdb2.tar.gz
Qt-0ff3bb25df3626a8112def75fc3ff048c70ebdb2.tar.bz2
Fixed crash in QWizard running on old Windows systems.
When compiling the QWizard on a Windows system where QT_NO_STYLE_WINDOWSVISTA is not set and running the app on an old system that has no Vista support, the app would crash in the paint event of the Vista Back button. In this scenario, the Vista Back button is not needed (i.e. the regular Back button next to the Next button is used), so the fix is simply to avoid instanciating it altogether. Reviewed-by: janarve Task-number: 252662
Diffstat (limited to 'src/gui/dialogs/qwizard_win.cpp')
-rw-r--r--src/gui/dialogs/qwizard_win.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/dialogs/qwizard_win.cpp b/src/gui/dialogs/qwizard_win.cpp
index 64696de..8aad4af 100644
--- a/src/gui/dialogs/qwizard_win.cpp
+++ b/src/gui/dialogs/qwizard_win.cpp
@@ -239,9 +239,11 @@ void QVistaBackButton::paintEvent(QPaintEvent *)
QVistaHelper::QVistaHelper(QWizard *wizard)
: pressed(false)
, wizard(wizard)
+ , backButton_(0)
{
is_vista = resolveSymbols();
- backButton_ = new QVistaBackButton(wizard);
+ if (is_vista)
+ backButton_ = new QVistaBackButton(wizard);
}
QVistaHelper::~QVistaHelper()
@@ -310,6 +312,7 @@ void QVistaHelper::drawTitleBar(QPainter *painter)
QRect(0, 0, wizard->width(), titleBarSize() + topOffset()),
painter->paintEngine()->getDC());
+ Q_ASSERT(backButton_);
const int btnTop = backButton_->mapToParent(QPoint()).y();
const int btnHeight = backButton_->size().height();
const int verticalCenter = (btnTop + btnHeight / 2);