summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@nokia.com>2010-12-22 16:13:30 (GMT)
committerSamuli Piippo <samuli.piippo@digia.com>2011-06-09 10:07:09 (GMT)
commit037144a9cb4c7674322e63f9d93fe10561332b58 (patch)
tree3f1ee5d7345030262f0272111f6b7206626d4fb5 /src/gui
parentb56699f89fe65591a63af7fbfc44c253da7037b6 (diff)
downloadQt-037144a9cb4c7674322e63f9d93fe10561332b58.zip
Qt-037144a9cb4c7674322e63f9d93fe10561332b58.tar.gz
Qt-037144a9cb4c7674322e63f9d93fe10561332b58.tar.bz2
Fix crash in indeterminate progressbars on windows
Note that this is a surgical fix for 4.7 only. In 4.8 we will add these checks at the top of the styling functions or in the widgets instead. Task-number:QTBUG-15227 Reviewed-by:gabi (cherry picked from commit 8a3c4c8283e4762744a29262ce507713565c1c0c)
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/styles/qcommonstyle.cpp5
-rw-r--r--src/gui/styles/qwindowsstyle.cpp4
2 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp
index c985c74..8a9cda0 100644
--- a/src/gui/styles/qcommonstyle.cpp
+++ b/src/gui/styles/qcommonstyle.cpp
@@ -1402,8 +1402,9 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
}
break;
case CE_ProgressBarGroove:
- qDrawShadePanel(p, opt->rect, opt->palette, true, 1,
- &opt->palette.brush(QPalette::Window));
+ if (opt->rect.isValid())
+ qDrawShadePanel(p, opt->rect, opt->palette, true, 1,
+ &opt->palette.brush(QPalette::Window));
break;
case CE_ProgressBarLabel:
if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) {
diff --git a/src/gui/styles/qwindowsstyle.cpp b/src/gui/styles/qwindowsstyle.cpp
index 48a412b..d2eb219 100644
--- a/src/gui/styles/qwindowsstyle.cpp
+++ b/src/gui/styles/qwindowsstyle.cpp
@@ -2395,8 +2395,10 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
#ifndef QT_NO_PROGRESSBAR
case CE_ProgressBarContents:
if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) {
-
QRect rect = pb->rect;
+ if (!rect.isValid())
+ return;
+
bool vertical = false;
bool inverted = false;