From dfddabe1157bc6d826612b82d5bfb301205e7ad5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 9 Dec 2011 09:02:48 +0100 Subject: QDial: Fix crash when singleStep-property is 0. Task-number: QTBUG-23072 Change-Id: I296b46af23420b24fa5460b9660e33bf203ea29f Reviewed-by: Jarek Kobus (cherry picked from commit 6d370a19e367d0ccec59db5c34cbe2e3f7cfc586) Reviewed-by: Friedemann Kleint --- src/widgets/styles/qstylehelper.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/widgets/styles/qstylehelper.cpp') 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; -- cgit v1.2.3