Skip to content
Permalink
Browse files

Fix range widget wrapper not correctly respecting default allow

null setting
  • Loading branch information
nyalldawson committed Nov 7, 2016
1 parent 94413c3 commit 11405af0676ca7d66cebb6c5d1d9f7bd4d8a6dc4
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/gui/editorwidgets/qgsrangewidgetwrapper.cpp
@@ -175,15 +175,15 @@ QVariant QgsRangeWidgetWrapper::value() const
if ( mDoubleSpinBox )
{
value = mDoubleSpinBox->value();
if ( value == mDoubleSpinBox->minimum() && config( QStringLiteral( "AllowNull" ) ).toBool() )
if ( value == mDoubleSpinBox->minimum() && config( QStringLiteral( "AllowNull" ), true ).toBool() )
{
value = QVariant( field().type() );
}
}
else if ( mIntSpinBox )
{
value = mIntSpinBox->value();
if ( value == mIntSpinBox->minimum() && config( QStringLiteral( "AllowNull" ) ).toBool() )
if ( value == mIntSpinBox->minimum() && config( QStringLiteral( "AllowNull" ), true ).toBool() )
{
value = QVariant( field().type() );
}
@@ -212,7 +212,7 @@ void QgsRangeWidgetWrapper::setValue( const QVariant& value )
{
if ( mDoubleSpinBox )
{
if ( value.isNull() && config( QStringLiteral( "AllowNull" ) ).toBool() )
if ( value.isNull() && config( QStringLiteral( "AllowNull" ), true ).toBool() )
{
mDoubleSpinBox->setValue( mDoubleSpinBox->minimum() );
}
@@ -224,7 +224,7 @@ void QgsRangeWidgetWrapper::setValue( const QVariant& value )

if ( mIntSpinBox )
{
if ( value.isNull() && config( QStringLiteral( "AllowNull" ) ).toBool() )
if ( value.isNull() && config( QStringLiteral( "AllowNull" ), true ).toBool() )
{
mIntSpinBox->setValue( mIntSpinBox->minimum() );
}

0 comments on commit 11405af

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