mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
Merge pull request #9033 from mhugo/fix_20831
Fix "Allow null" in range widget (fixes #20831)
This commit is contained in:
commit
fa1f8762d5
@ -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 )
|
||||
|
Loading…
x
Reference in New Issue
Block a user