diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-12-09 09:02:48 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-16 04:23:20 +0100 |
commit | dfddabe1157bc6d826612b82d5bfb301205e7ad5 (patch) | |
tree | 07ab5be11579abef2274982b5f6ca6b8fe34ef2c /src/widgets/styles/qstylehelper.cpp | |
parent | eb64bb89cf6b7aa892c44723e3d14b845cc178bd (diff) |
QDial: Fix crash when singleStep-property is 0.
Task-number: QTBUG-23072
Change-Id: I296b46af23420b24fa5460b9660e33bf203ea29f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@nokia.com>
(cherry picked from commit 6d370a19e367d0ccec59db5c34cbe2e3f7cfc586)
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src/widgets/styles/qstylehelper.cpp')
-rw-r--r-- | src/widgets/styles/qstylehelper.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/widgets/styles/qstylehelper.cpp b/src/widgets/styles/qstylehelper.cpp index 818671f85f..3fdbc98323 100644 --- a/src/widgets/styles/qstylehelper.cpp +++ b/src/widgets/styles/qstylehelper.cpp @@ -159,7 +159,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; |