From 3f8a860503c78689c981234f874771f8b1277c97 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Wed, 24 Sep 2014 17:10:39 +0200 Subject: [PATCH] Editor widgets: Show NULL value on numeric line edit --- src/gui/editorwidgets/qgstexteditwrapper.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/editorwidgets/qgstexteditwrapper.cpp b/src/gui/editorwidgets/qgstexteditwrapper.cpp index 34c4c7198f0..e41c5d7a91d 100644 --- a/src/gui/editorwidgets/qgstexteditwrapper.cpp +++ b/src/gui/editorwidgets/qgstexteditwrapper.cpp @@ -95,7 +95,11 @@ void QgsTextEditWrapper::initWidget( QWidget* editor ) mLineEdit->setValidator( new QgsFieldValidator( mLineEdit, field() ) ); QgsFilterLineEdit *fle = qobject_cast( 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() ); }