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>bb10
parent
eb64bb89cf
commit
dfddabe115
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue