35 return new QComboBox( parent );
38void QgsValueMapSearchWidgetWrapper::comboBoxIndexChanged(
int idx )
90 return fieldName +
" IS NULL";
92 return fieldName +
" IS NOT NULL";
95 if ( mComboBox->currentIndex() == 0 )
98 const QString currentKey = mComboBox->currentData().toString();
104 case QVariant::Double:
105 case QVariant::LongLong:
106 case QVariant::ULongLong:
109 return fieldName +
'=' + currentKey;
111 return fieldName +
"<>" + currentKey;
118 return fieldName +
"='" + currentKey +
'\'';
120 return fieldName +
"<>'" + currentKey +
'\'';
130 mComboBox->setCurrentIndex( 0 );
135 mComboBox->setEnabled( enabled );
140 mComboBox = qobject_cast<QComboBox *>( editor );
145 mComboBox->insertItem( 0, tr(
"Please select" ), QString() );
147 connect( mComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsValueMapSearchWidgetWrapper::comboBoxIndexChanged );
157 str = QStringLiteral(
"%1 = '%2'" )
159 exp.replace(
'\'', QLatin1String(
"''" ) ) );
static QString quotedColumnRef(QString name)
Returns a quoted column reference (in double quotes)
QgsField at(int i) const
Returns the field at particular index (must be in range 0..N-1).
static void populateComboBox(QComboBox *comboBox, const QVariantMap &configuration, bool skipNull)
Populates a comboBox with the appropriate entries based on a value map configuration.
Represents a vector layer which manages a vector based data sets.
QgsFields fields() const FINAL
Returns the list of fields of this layer.