Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix range widget wrapper not correctly respecting default allow
null setting
  • Loading branch information
nyalldawson committed Nov 7, 2016
1 parent 94413c3 commit 11405af
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gui/editorwidgets/qgsrangewidgetwrapper.cpp
Expand Up @@ -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() );
}
Expand Down Expand Up @@ -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() );
}
Expand All @@ -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() );
}
Expand Down

0 comments on commit 11405af

Please sign in to comment.