Skip to content

Commit

Permalink
pass SpecialValueText as NullValue
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed Nov 13, 2018
1 parent 8350fb4 commit 6da99a1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gui/editorwidgets/qgsdoublespinbox.cpp
Expand Up @@ -155,9 +155,15 @@ void QgsDoubleSpinBox::setLineEditAlignment( Qt::Alignment alignment )
void QgsDoubleSpinBox::setSpecialValueText( const QString &txt )
{
if ( txt.isEmpty() )
{
QDoubleSpinBox::setSpecialValueText( SPECIAL_TEXT_WHEN_EMPTY );
mLineEdit->setNullValue( SPECIAL_TEXT_WHEN_EMPTY );
}
else
{
QDoubleSpinBox::setSpecialValueText( txt );
mLineEdit->setNullValue( SPECIAL_TEXT_WHEN_EMPTY );
}
}

QString QgsDoubleSpinBox::stripped( const QString &originalText ) const
Expand Down
6 changes: 6 additions & 0 deletions src/gui/editorwidgets/qgsspinbox.cpp
Expand Up @@ -152,9 +152,15 @@ void QgsSpinBox::setLineEditAlignment( Qt::Alignment alignment )
void QgsSpinBox::setSpecialValueText( const QString &txt )
{
if ( txt.isEmpty() )
{
QSpinBox::setSpecialValueText( SPECIAL_TEXT_WHEN_EMPTY );
mLineEdit->setNullValue( SPECIAL_TEXT_WHEN_EMPTY );
}
else
{
QSpinBox::setSpecialValueText( txt );
mLineEdit->setNullValue( txt );
}
}

int QgsSpinBox::valueFromText( const QString &text ) const
Expand Down

0 comments on commit 6da99a1

Please sign in to comment.