summaryrefslogtreecommitdiffstats
path: root/src/gui/styles
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2011-12-09 08:02:48 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-02-15 01:15:15 (GMT)
commit6d370a19e367d0ccec59db5c34cbe2e3f7cfc586 (patch)
tree1737df22e81fef65fff4ac7834551ad4f563da2c /src/gui/styles
parentcdd09cc4ebab4e95f7c1286f09cef17a2c9cedf4 (diff)
downloadQt-6d370a19e367d0ccec59db5c34cbe2e3f7cfc586.zip
Qt-6d370a19e367d0ccec59db5c34cbe2e3f7cfc586.tar.gz
Qt-6d370a19e367d0ccec59db5c34cbe2e3f7cfc586.tar.bz2
QDial: Fix crash when singleStep-property is 0.
Task-number: QTBUG-23072 Change-Id: I296b46af23420b24fa5460b9660e33bf203ea29f Reviewed-by: Jarek Kobus <jaroslaw.kobus@nokia.com>
Diffstat (limited to 'src/gui/styles')
-rw-r--r--src/gui/styles/qstylehelper.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/styles/qstylehelper.cpp b/src/gui/styles/qstylehelper.cpp
index 823d29b..dc352b1 100644
--- a/src/gui/styles/qstylehelper.cpp
+++ b/src/gui/styles/qstylehelper.cpp
@@ -176,7 +176,9 @@ QPolygonF calcLines(const QStyleOptionSlider *dial)
qreal xc = width / 2 + 0.5;
qreal yc = height / 2 + 0.5;
- int ns = dial->tickInterval;
+ const int ns = dial->tickInterval;
+ if (!ns) // Invalid values may be set by Qt Designer.
+ return poly;
int notches = (dial->maximum + ns - 1 - dial->minimum) / ns;
if (notches <= 0)
return poly;