21#include "moc_qgsclassificationwidgetwrapper.cpp"
31 return mComboBox->currentData();
41 QComboBox *combo =
new QComboBox( parent );
42 combo->setMinimumContentsLength( 1 );
43 combo->setSizeAdjustPolicy( QComboBox::SizeAdjustPolicy::AdjustToMinimumContentsLengthWithIcon );
49 mComboBox = qobject_cast<QComboBox *>( editor );
57 for (
int i = 0; i < categories.size(); i++ )
59 QString label = categories[i].label();
60 const QString
value = categories[i].value().toString();
61 if ( label.isEmpty() )
64 mComboBox->addItem( label,
value );
77void QgsClassificationWidgetWrapper::updateValues(
const QVariant &value,
const QVariantList & )
79 mComboBox->setCurrentIndex( mComboBox->findData(
value ) );
A feature renderer which represents features using a list of renderer categories.
const QgsCategoryList & categories() const
Returns a list of all categories recognized by the renderer.
Represents a vector layer which manages a vector based dataset.
QgsFeatureRenderer * renderer()
Returns the feature renderer used for rendering the features in the layer in 2D map views.
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
QList< QgsRendererCategory > QgsCategoryList