Skip to content
Permalink
Browse files

Merge pull request #9033 from mhugo/fix_20831

Fix "Allow null" in range widget (fixes #20831)
  • Loading branch information
Hugo Mercier
Hugo Mercier committed Jan 30, 2019
2 parents 3769faa + eb5a336 commit fa1f8762d56897a085232fb17724992adf40c60c
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/gui/editorwidgets/qgsrangewidgetwrapper.cpp
@@ -146,7 +146,12 @@ void QgsRangeWidgetWrapper::initWidget( QWidget *editor )
if ( allowNull )
{
int stepval = step.isValid() ? step.toInt() : 1;
minval -= stepval;
int newMinval = minval - stepval;
// make sure there is room for a new value (i.e. signed integer does not overflow)
if ( newMinval < minval )
{
minval = newMinval;
}
mIntSpinBox->setValue( minval );
QgsSpinBox *intSpinBox( qobject_cast<QgsSpinBox *>( mIntSpinBox ) );
if ( intSpinBox )

0 comments on commit fa1f876

Please sign in to comment.
You can’t perform that action at this time.