summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qstylehelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/styles/qstylehelper.cpp')
-rw-r--r--src/widgets/styles/qstylehelper.cpp4
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;