Skip to content

Commit 6da99a1

Browse files
committedNov 13, 2018
pass SpecialValueText as NullValue
1 parent 8350fb4 commit 6da99a1

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed
 

‎src/gui/editorwidgets/qgsdoublespinbox.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,15 @@ void QgsDoubleSpinBox::setLineEditAlignment( Qt::Alignment alignment )
155155
void QgsDoubleSpinBox::setSpecialValueText( const QString &txt )
156156
{
157157
if ( txt.isEmpty() )
158+
{
158159
QDoubleSpinBox::setSpecialValueText( SPECIAL_TEXT_WHEN_EMPTY );
160+
mLineEdit->setNullValue( SPECIAL_TEXT_WHEN_EMPTY );
161+
}
159162
else
163+
{
160164
QDoubleSpinBox::setSpecialValueText( txt );
165+
mLineEdit->setNullValue( SPECIAL_TEXT_WHEN_EMPTY );
166+
}
161167
}
162168

163169
QString QgsDoubleSpinBox::stripped( const QString &originalText ) const

‎src/gui/editorwidgets/qgsspinbox.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,15 @@ void QgsSpinBox::setLineEditAlignment( Qt::Alignment alignment )
152152
void QgsSpinBox::setSpecialValueText( const QString &txt )
153153
{
154154
if ( txt.isEmpty() )
155+
{
155156
QSpinBox::setSpecialValueText( SPECIAL_TEXT_WHEN_EMPTY );
157+
mLineEdit->setNullValue( SPECIAL_TEXT_WHEN_EMPTY );
158+
}
156159
else
160+
{
157161
QSpinBox::setSpecialValueText( txt );
162+
mLineEdit->setNullValue( txt );
163+
}
158164
}
159165

160166
int QgsSpinBox::valueFromText( const QString &text ) const

0 commit comments

Comments
 (0)
Please sign in to comment.