Skip to content

Commit

Permalink
re-introduce resetting of attribute values
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jun 1, 2014
1 parent 08ed60f commit 701c227
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/gui/editorwidgets/qgstexteditwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "qgsfield.h"
#include "qgsfieldvalidator.h"
#include "qgsfilterlineedit.h"

#include <QSettings>

Expand Down Expand Up @@ -75,7 +76,7 @@ QWidget* QgsTextEditWidget::createWidget( QWidget* parent )
}
else
{
return new QLineEdit( parent );
return new QgsFilterLineEdit( parent );
}
}

Expand All @@ -94,6 +95,14 @@ void QgsTextEditWidget::initWidget( QWidget* editor )
if ( mLineEdit )
{
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 ) )
{
QSettings settings;
fle->setNullValue( settings.value( "qgis/nullValue", "NULL" ).toString() );
}

connect( mLineEdit, SIGNAL( textChanged( QString ) ), this, SLOT( valueChanged( QString ) ) );
}
}
Expand Down

0 comments on commit 701c227

Please sign in to comment.