22#include "moc_qgsenumerationwidgetwrapper.cpp"
35 value = mComboBox->currentData();
50 QComboBox *combo =
new QComboBox( parent );
51 combo->setMinimumContentsLength( 1 );
52 combo->setSizeAdjustPolicy( QComboBox::SizeAdjustPolicy::AdjustToMinimumContentsLengthWithIcon );
58 mComboBox = qobject_cast<QComboBox *>( editor );
69 const QList<QPair<QString, QString>> values(
layer()->dataProvider()->codedValues(
fieldIdx() ) );
70 for (
const QPair<QString, QString> &pair : values )
72 mComboBox->addItem( pair.second, pair.first );
83void QgsEnumerationWidgetWrapper::updateValues(
const QVariant &value,
const QVariantList & )
87 mComboBox->setCurrentIndex( mComboBox->findData(
value ) );
static QString nullRepresentation()
Returns the string used to represent the value NULL throughout QGIS.
@ ConstraintNotNull
Field may not be null.
Encapsulate a field in an attribute table or data source.
static QVariant createNullVariant(QMetaType::Type metaType)
Helper method to properly create a null QVariant from a metaType Returns the created QVariant.
Represents a vector layer which manages a vector based dataset.
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.