QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
25 #include <QSizePolicy>
35 return new QComboBox( parent );
38 void QgsValueMapSearchWidgetWrapper::comboBoxIndexChanged(
int idx )
90 return fieldName +
" IS NULL";
92 return fieldName +
" IS NOT NULL";
95 if ( mComboBox->currentIndex() == 0 )
98 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 void populateComboBox(QComboBox *comboBox, const QVariantMap &configuration, bool skipNull)
Populates a comboBox with the appropriate entries based on a value map configuration.
QgsFields fields() const FINAL
Returns the list of fields of this layer.
Represents a vector layer which manages a vector based data sets.
static QString quotedColumnRef(QString name)
Returns a quoted column reference (in double quotes)
QgsField at(int i) const
Gets field at particular index (must be in range 0..N-1)