33 value = mComboBox->currentData();
48 QComboBox *combo =
new QComboBox( parent );
49 combo->setMinimumContentsLength( 1 );
50 combo->setSizeAdjustPolicy( QComboBox::SizeAdjustPolicy::AdjustToMinimumContentsLengthWithIcon );
56 mComboBox = qobject_cast<QComboBox *>( editor );
60 QStringList enumValues;
63 const auto constEnumValues = enumValues;
64 for (
const QString &s : constEnumValues )
66 mComboBox->addItem( s, s );
68 connect( mComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
78void QgsEnumerationWidgetWrapper::updateValues(
const QVariant &value,
const QVariantList & )
82 mComboBox->setCurrentIndex( mComboBox->findData(
value ) );
virtual void enumValues(int index, QStringList &enumList) const
Returns the possible enum values of an attribute.
Represents a vector layer which manages a vector based data sets.
QgsVectorDataProvider * dataProvider() FINAL
Returns the layer's data provider, it may be nullptr.
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.