We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3769faa + eb5a336 commit fa1f876Copy full SHA for fa1f876
src/gui/editorwidgets/qgsrangewidgetwrapper.cpp
@@ -146,7 +146,12 @@ void QgsRangeWidgetWrapper::initWidget( QWidget *editor )
146
if ( allowNull )
147
{
148
int stepval = step.isValid() ? step.toInt() : 1;
149
- minval -= stepval;
+ int newMinval = minval - stepval;
150
+ // make sure there is room for a new value (i.e. signed integer does not overflow)
151
+ if ( newMinval < minval )
152
+ {
153
+ minval = newMinval;
154
+ }
155
mIntSpinBox->setValue( minval );
156
QgsSpinBox *intSpinBox( qobject_cast<QgsSpinBox *>( mIntSpinBox ) );
157
if ( intSpinBox )
0 commit comments