17#include "moc_qgsvaluemapwidgetwrapper.cpp"
37 v = mComboBox->currentData();
56 QComboBox *combo =
new QComboBox( parent );
57 combo->setMinimumContentsLength( 1 );
58 combo->setSizeAdjustPolicy( QComboBox::SizeAdjustPolicy::AdjustToMinimumContentsLengthWithIcon );
64 mComboBox = qobject_cast<QComboBox *>( editor );
69 mComboBox->view()->setVerticalScrollBarPolicy( Qt::ScrollBarAsNeeded );
70 connect( mComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
80void QgsValueMapWidgetWrapper::updateValues(
const QVariant &value,
const QVariantList & )
90 if ( mComboBox->findData( v ) == -1 )
98 mComboBox->addItem( QString( v ).prepend(
'(' ).append(
')' ), v );
101 mComboBox->setCurrentIndex( mComboBox->findData( v ) );
static QString nullRepresentation()
Returns the string used to represent the value NULL throughout QGIS.
static void populateComboBox(QComboBox *comboBox, const QVariantMap &configuration, bool skipNull)
Populates a comboBox with the appropriate entries based on a value map configuration.
static bool isNull(const QVariant &variant, bool silenceNullWarnings=false)
Returns true if the specified variant should be considered a NULL value.
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 data sets.
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.