Skip to content

Commit 11405af

Browse files
committed
Fix range widget wrapper not correctly respecting default allow
null setting
1 parent 94413c3 commit 11405af

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/gui/editorwidgets/qgsrangewidgetwrapper.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,15 @@ QVariant QgsRangeWidgetWrapper::value() const
175175
if ( mDoubleSpinBox )
176176
{
177177
value = mDoubleSpinBox->value();
178-
if ( value == mDoubleSpinBox->minimum() && config( QStringLiteral( "AllowNull" ) ).toBool() )
178+
if ( value == mDoubleSpinBox->minimum() && config( QStringLiteral( "AllowNull" ), true ).toBool() )
179179
{
180180
value = QVariant( field().type() );
181181
}
182182
}
183183
else if ( mIntSpinBox )
184184
{
185185
value = mIntSpinBox->value();
186-
if ( value == mIntSpinBox->minimum() && config( QStringLiteral( "AllowNull" ) ).toBool() )
186+
if ( value == mIntSpinBox->minimum() && config( QStringLiteral( "AllowNull" ), true ).toBool() )
187187
{
188188
value = QVariant( field().type() );
189189
}
@@ -212,7 +212,7 @@ void QgsRangeWidgetWrapper::setValue( const QVariant& value )
212212
{
213213
if ( mDoubleSpinBox )
214214
{
215-
if ( value.isNull() && config( QStringLiteral( "AllowNull" ) ).toBool() )
215+
if ( value.isNull() && config( QStringLiteral( "AllowNull" ), true ).toBool() )
216216
{
217217
mDoubleSpinBox->setValue( mDoubleSpinBox->minimum() );
218218
}
@@ -224,7 +224,7 @@ void QgsRangeWidgetWrapper::setValue( const QVariant& value )
224224

225225
if ( mIntSpinBox )
226226
{
227-
if ( value.isNull() && config( QStringLiteral( "AllowNull" ) ).toBool() )
227+
if ( value.isNull() && config( QStringLiteral( "AllowNull" ), true ).toBool() )
228228
{
229229
mIntSpinBox->setValue( mIntSpinBox->minimum() );
230230
}

0 commit comments

Comments
 (0)