36 value = mComboBox->itemData( mComboBox->currentIndex() );
40 if ( mLineEdit->text() == QSettings().value(
"qgis/nullValue",
"NULL" ).toString() )
43 value = mLineEdit->text();
51 if (
config(
"Editable" ).toBool() )
54 return new QComboBox( parent );
59 mComboBox = qobject_cast<QComboBox*>( editor );
60 mLineEdit = qobject_cast<QLineEdit*>( editor );
64 QList<QVariant> values;
68 Q_FOREACH ( QVariant v, values )
72 mComboBox->addItem( v.toString(), v );
77 sValues << v.toString();
84 if ( fle && !(
field().type() == QVariant::Int ||
field().type() == QVariant::Double ||
field().type() == QVariant::LongLong ||
field().type() == QVariant::Date ) )
89 QCompleter* c =
new QCompleter( sValues );
90 c->setCompletionMode( QCompleter::PopupCompletion );
91 mLineEdit->setCompleter( c );
93 connect( mLineEdit, SIGNAL( textChanged( QString ) ),
this, SLOT(
valueChanged( QString ) ) );
98 connect( mComboBox, SIGNAL( currentIndexChanged(
int ) ),
this, SLOT(
valueChanged() ) );
106 mComboBox->setCurrentIndex( mComboBox->findData( value ) );
111 if ( value.isNull() )
112 mLineEdit->setText( QSettings().
value(
"qgis/nullValue",
"NULL" ).toString() );
114 mLineEdit->setText( value.toString() );