Skip to content
Permalink
Browse files

pass SpecialValueText as NullValue

  • Loading branch information
signedav committed Nov 8, 2018
1 parent 8350fb4 commit 6da99a1866cfbb9c16aab7d8b92260b135432e60
Showing with 12 additions and 0 deletions.
  1. +6 −0 src/gui/editorwidgets/qgsdoublespinbox.cpp
  2. +6 −0 src/gui/editorwidgets/qgsspinbox.cpp
@@ -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
@@ -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

0 comments on commit 6da99a1

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