QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
This offers a combobox with autocompleter that allows selecting features from a layer. More...
#include <qgsfeaturelistcombobox.h>
Signals | |
void | allowNullChanged () |
Determines if a NULL value should be available in the list. | |
void | currentFeatureChanged () |
Emitted when the current feature changes. | |
void | currentFeatureFoundChanged (bool found) |
Emitted when the feature picker model changes its feature found state. | |
void | displayExpressionChanged () |
The display expression will be used to display features as well as the the value to match the typed text against. | |
void | filterExpressionChanged () |
An additional expression to further restrict the available features. | |
void | identifierFieldChanged () |
Field name that will be used to uniquely identify the current feature. | |
void | identifierValueChanged () |
The identifier value of the currently selected feature. | |
void | modelUpdated () |
The underlying model has been updated. | |
void | sourceLayerChanged () |
The layer from which features should be listed. | |
Public Member Functions | |
QgsFeatureListComboBox (QWidget *parent=nullptr) | |
Create a new QgsFeatureListComboBox, optionally specifying a parent. | |
bool | allowNull () const |
Determines if a NULL value should be available in the list. | |
QgsFeatureRequest | currentFeatureRequest () const |
Shorthand for getting a feature request to query the currently selected feature. | |
QModelIndex | currentModelIndex () const |
The index of the currently selected item. | |
QString | displayExpression () const |
The display expression will be used to display features as well as the value to match the typed text against. | |
int | fetchLimit () const |
Returns the feature request fetch limit. | |
QString | filterExpression () const |
An additional expression to further restrict the available features. | |
void | focusOutEvent (QFocusEvent *event) override |
Q_DECL_DEPRECATED QString | identifierField () const |
Field name that will be used to uniquely identify the current feature. | |
QStringList | identifierFields () const |
Field name that will be used to uniquely identify the current feature. | |
Q_DECL_DEPRECATED QVariant | identifierValue () const |
The identifier value of the currently selected feature. | |
QVariantList | identifierValues () const |
The identifier values of the currently selected feature. | |
void | keyPressEvent (QKeyEvent *event) override |
int | nullIndex () const |
Returns the current index of the NULL value, or -1 if NULL values are not allowed. | |
void | setAllowNull (bool allowNull) |
Determines if a NULL value should be available in the list. | |
void | setCurrentFeature (const QgsFeature &feature) |
Sets the current index by using the given feature. | |
void | setDisplayExpression (const QString &displayExpression) |
The display expression will be used to display features as well as the value to match the typed text against. | |
void | setFetchLimit (int fetchLimit) |
Defines the feature request fetch limit If set to 0, no limit is applied when fetching. | |
void | setFilterExpression (const QString &filterExpression) |
An additional expression to further restrict the available features. | |
Q_DECL_DEPRECATED void | setIdentifierField (const QString &identifierField) |
Field name that will be used to uniquely identify the current feature. | |
void | setIdentifierFields (const QStringList &identifierFields) |
Field name that will be used to uniquely identify the current feature. | |
Q_DECL_DEPRECATED void | setIdentifierValue (const QVariant &identifierValue) |
The identifier value of the currently selected feature. | |
void | setIdentifierValues (const QVariantList &identifierValues) |
The identifier values of the currently selected feature. | |
void | setIdentifierValuesToNull () |
Sets the identifier values of the currently selected feature to NULL value(s). | |
void | setSourceLayer (QgsVectorLayer *sourceLayer) |
The layer from which features should be listed. | |
QgsVectorLayer * | sourceLayer () const |
The layer from which features should be listed. | |
Properties | |
bool | allowNull |
QString | displayExpression |
QString | filterExpression |
QString | identifierField |
QVariant | identifierValue |
QVariantList | identifierValues |
QgsVectorLayer * | sourceLayer |
Friends | |
class | TestQgsFeatureListComboBox |
This offers a combobox with autocompleter that allows selecting features from a layer.
It will show up to 100 entries at a time. The entries can be chosen based on the displayExpression and whenever text is typed into the combobox, the completer and popup will adjust to features matching the typed text.
Definition at line 37 of file qgsfeaturelistcombobox.h.
QgsFeatureListComboBox::QgsFeatureListComboBox | ( | QWidget * | parent = nullptr | ) |
Create a new QgsFeatureListComboBox, optionally specifying a parent.
Definition at line 28 of file qgsfeaturelistcombobox.cpp.
bool QgsFeatureListComboBox::allowNull | ( | ) | const |
Determines if a NULL value should be available in the list.
Definition at line 244 of file qgsfeaturelistcombobox.cpp.
|
signal |
Determines if a NULL value should be available in the list.
|
signal |
Emitted when the current feature changes.
|
signal |
Emitted when the feature picker model changes its feature found state.
QgsFeatureRequest QgsFeatureListComboBox::currentFeatureRequest | ( | ) | const |
Shorthand for getting a feature request to query the currently selected feature.
Definition at line 292 of file qgsfeaturelistcombobox.cpp.
QModelIndex QgsFeatureListComboBox::currentModelIndex | ( | ) | const |
The index of the currently selected item.
Definition at line 223 of file qgsfeaturelistcombobox.cpp.
QString QgsFeatureListComboBox::displayExpression | ( | ) | const |
The display expression will be used to display features as well as the value to match the typed text against.
Definition at line 96 of file qgsfeaturelistcombobox.cpp.
|
signal |
The display expression will be used to display features as well as the the value to match the typed text against.
int QgsFeatureListComboBox::fetchLimit | ( | ) | const |
Returns the feature request fetch limit.
Definition at line 255 of file qgsfeaturelistcombobox.cpp.
QString QgsFeatureListComboBox::filterExpression | ( | ) | const |
An additional expression to further restrict the available features.
This can be used to integrate additional spatial or other constraints.
Definition at line 319 of file qgsfeaturelistcombobox.cpp.
|
signal |
An additional expression to further restrict the available features.
This can be used to integrate additional spatial or other constraints.
|
override |
Definition at line 228 of file qgsfeaturelistcombobox.cpp.
QString QgsFeatureListComboBox::identifierField | ( | ) | const |
Field name that will be used to uniquely identify the current feature.
Normally the primary key of the layer.
Definition at line 199 of file qgsfeaturelistcombobox.cpp.
|
signal |
Field name that will be used to uniquely identify the current feature.
Normally the primary key of the layer.
QStringList QgsFeatureListComboBox::identifierFields | ( | ) | const |
Field name that will be used to uniquely identify the current feature.
Normally the primary key of the layer.
Definition at line 208 of file qgsfeaturelistcombobox.cpp.
QVariant QgsFeatureListComboBox::identifierValue | ( | ) | const |
The identifier value of the currently selected feature.
A value from the identifierField.
Definition at line 265 of file qgsfeaturelistcombobox.cpp.
|
signal |
The identifier value of the currently selected feature.
A value from the identifierField.
QVariantList QgsFeatureListComboBox::identifierValues | ( | ) | const |
The identifier values of the currently selected feature.
A value from the identifierField.
Definition at line 272 of file qgsfeaturelistcombobox.cpp.
|
override |
Definition at line 235 of file qgsfeaturelistcombobox.cpp.
|
signal |
The underlying model has been updated.
int QgsFeatureListComboBox::nullIndex | ( | ) | const |
Returns the current index of the NULL value, or -1 if NULL values are not allowed.
Definition at line 173 of file qgsfeaturelistcombobox.cpp.
void QgsFeatureListComboBox::setAllowNull | ( | bool | allowNull | ) |
Determines if a NULL value should be available in the list.
Definition at line 249 of file qgsfeaturelistcombobox.cpp.
void QgsFeatureListComboBox::setCurrentFeature | ( | const QgsFeature & | feature | ) |
Sets the current index by using the given feature.
Definition at line 85 of file qgsfeaturelistcombobox.cpp.
void QgsFeatureListComboBox::setDisplayExpression | ( | const QString & | displayExpression | ) |
The display expression will be used to display features as well as the value to match the typed text against.
Definition at line 101 of file qgsfeaturelistcombobox.cpp.
void QgsFeatureListComboBox::setFetchLimit | ( | int | fetchLimit | ) |
Defines the feature request fetch limit If set to 0, no limit is applied when fetching.
Definition at line 260 of file qgsfeaturelistcombobox.cpp.
void QgsFeatureListComboBox::setFilterExpression | ( | const QString & | filterExpression | ) |
An additional expression to further restrict the available features.
This can be used to integrate additional spatial or other constraints.
Definition at line 324 of file qgsfeaturelistcombobox.cpp.
void QgsFeatureListComboBox::setIdentifierField | ( | const QString & | identifierField | ) |
Field name that will be used to uniquely identify the current feature.
Normally the primary key of the layer.
Definition at line 213 of file qgsfeaturelistcombobox.cpp.
void QgsFeatureListComboBox::setIdentifierFields | ( | const QStringList & | identifierFields | ) |
Field name that will be used to uniquely identify the current feature.
Normally the primary key of the layer.
Definition at line 218 of file qgsfeaturelistcombobox.cpp.
void QgsFeatureListComboBox::setIdentifierValue | ( | const QVariant & | identifierValue | ) |
The identifier value of the currently selected feature.
A value from the identifierField.
Definition at line 277 of file qgsfeaturelistcombobox.cpp.
void QgsFeatureListComboBox::setIdentifierValues | ( | const QVariantList & | identifierValues | ) |
The identifier values of the currently selected feature.
A value from the identifierFields.
Definition at line 282 of file qgsfeaturelistcombobox.cpp.
void QgsFeatureListComboBox::setIdentifierValuesToNull | ( | ) |
Sets the identifier values of the currently selected feature to NULL value(s).
Definition at line 287 of file qgsfeaturelistcombobox.cpp.
void QgsFeatureListComboBox::setSourceLayer | ( | QgsVectorLayer * | sourceLayer | ) |
The layer from which features should be listed.
Definition at line 80 of file qgsfeaturelistcombobox.cpp.
QgsVectorLayer * QgsFeatureListComboBox::sourceLayer | ( | ) | const |
The layer from which features should be listed.
Definition at line 75 of file qgsfeaturelistcombobox.cpp.
|
signal |
The layer from which features should be listed.
|
friend |
Definition at line 279 of file qgsfeaturelistcombobox.h.
|
readwrite |
Definition at line 47 of file qgsfeaturelistcombobox.h.
|
readwrite |
Definition at line 42 of file qgsfeaturelistcombobox.h.
|
readwrite |
Definition at line 43 of file qgsfeaturelistcombobox.h.
|
readwrite |
Definition at line 46 of file qgsfeaturelistcombobox.h.
|
readwrite |
Definition at line 44 of file qgsfeaturelistcombobox.h.
|
readwrite |
Definition at line 45 of file qgsfeaturelistcombobox.h.
|
readwrite |
Definition at line 41 of file qgsfeaturelistcombobox.h.