Skip to content

Commit

Permalink
Editor widgets: Show NULL value on numeric line edit
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Sep 24, 2014
1 parent db6a5a9 commit 3f8a860
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/gui/editorwidgets/qgstexteditwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ void QgsTextEditWrapper::initWidget( QWidget* editor )
mLineEdit->setValidator( new QgsFieldValidator( mLineEdit, field() ) );

QgsFilterLineEdit *fle = qobject_cast<QgsFilterLineEdit*>( mLineEdit );
if ( fle && !( field().type() == QVariant::Int || field().type() == QVariant::Double || field().type() == QVariant::LongLong || field().type() == QVariant::Date ) )
if ( field().type() == QVariant::Int || field().type() == QVariant::Double || field().type() == QVariant::LongLong || field().type() == QVariant::Date )
{
mLineEdit->setPlaceholderText( QSettings().value( "qgis/nullValue", "NULL" ).toString() );
}
else if ( fle )
{
fle->setNullValue( QSettings().value( "qgis/nullValue", "NULL" ).toString() );
}
Expand Down

0 comments on commit 3f8a860

Please sign in to comment.