23 #include <QSizePolicy> 27 , mComboBox( nullptr )
36 void QgsValueMapSearchWidgetWrapper::comboBoxIndexChanged(
int idx )
92 return fieldName +
" IS NULL";
94 return fieldName +
" IS NOT NULL";
102 case QVariant::Double:
103 case QVariant::LongLong:
104 case QVariant::ULongLong:
107 return fieldName +
'=' + currentKey;
109 return fieldName +
"<>" + currentKey;
116 return fieldName +
"='" + currentKey +
'\'';
118 return fieldName +
"<>'" + currentKey +
'\'';
138 mComboBox = qobject_cast<
QComboBox*>( editor );
143 QgsEditorWidgetConfig::ConstIterator it = cfg.constBegin();
144 mComboBox->
addItem(
tr(
"Please select" ),
"" );
146 while ( it != cfg.constEnd() )
148 mComboBox->
addItem( it.key(), it.value() );
151 connect( mComboBox, SIGNAL( currentIndexChanged(
int ) ),
this, SLOT( comboBoxIndexChanged(
int ) ) );
static QString quotedColumnRef(QString name)
Returns a quoted column reference (in double quotes)
QString tr(const char *sourceText, const char *disambiguation, int n)
const QgsField & at(int i) const
Get field at particular index (must be in range 0..N-1)
QgsFields fields() const
Returns the list of fields of this layer.
void addItem(const QString &text, const QVariant &userData)
const char * name() const
QVariantMap QgsEditorWidgetConfig
Holds a set of configuration parameters for a editor widget wrapper.
QVariant itemData(int index, int role) const
QString & replace(int position, int n, QChar after)
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Represents a vector layer which manages a vector based data sets.
QVariant::Type type() const
Gets variant type of the field as it will be retrieved from data source.
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const