QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
36 value = mComboBox->currentData();
43 value = mLineEdit->text();
51 if (
config( QStringLiteral(
"Editable" ) ).toBool() )
54 return new QComboBox( parent );
59 mComboBox = qobject_cast<QComboBox *>( editor );
60 mLineEdit = qobject_cast<QLineEdit *>( editor );
66 const auto constValues = values;
67 for (
const QVariant &v : constValues )
71 mComboBox->addItem( v.toString(), v );
76 sValues << v.toString();
83 if ( fle && !(
field().type() == QVariant::Int ||
field().type() == QVariant::Double ||
field().type() == QVariant::LongLong ||
field().type() == QVariant::Date ) )
88 QCompleter *
c =
new QCompleter( sValues );
89 c->setCaseSensitivity( Qt::CaseInsensitive );
90 c->setCompletionMode( QCompleter::PopupCompletion );
91 mLineEdit->setCompleter(
c );
93 connect( mLineEdit, &QLineEdit::textChanged,
this, [ = ](
const QString &
value )
104 connect( mComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
111 return mComboBox || mLineEdit;
126 void QgsUniqueValuesWidgetWrapper::updateValues(
const QVariant &value,
const QVariantList & )
130 mComboBox->setCurrentIndex( mComboBox->findData(
value ) );
135 if (
value.isNull() )
138 mLineEdit->setText(
value.toString() );
QLineEdit subclass with built in support for clearing the widget's value and handling custom null val...
#define Q_NOWARN_DEPRECATED_POP
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
static QString nullRepresentation()
This string is used to represent the value NULL throughout QGIS.
QSet< QVariant > uniqueValues(int fieldIndex, int limit=-1) const FINAL
Calculates a list of unique values contained within an attribute in the layer.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
Represents a vector layer which manages a vector based data sets.
void setNullValue(const QString &nullValue)
Sets the string representation for null values in the widget.
#define Q_NOWARN_DEPRECATED_PUSH