Class: QgsFeatureListComboBox¶
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.
Class Hierarchy¶
Base classes¶
Methods
Determines if a NULL value should be available in the list. |
|
Shorthand for getting a feature request to query the currently selected feature. |
|
The index of the currently selected item. |
|
The display expression will be used to display features as well as the value to match the typed text against. |
|
Returns the feature request fetch limit |
|
An additional expression to further restrict the available features. |
|
Returns an attribute form feature to be used with the filter expression. |
|
Field name that will be used to uniquely identify the current feature. |
|
Field name that will be used to uniquely identify the current feature. |
|
The identifier value of the currently selected feature. |
|
The identifier values of the currently selected feature. |
|
Returns the current index of the NULL value, or -1 if NULL values are not allowed. |
|
Returns a parent attribute form feature to be used with the filter expression. |
|
Determines if a NULL value should be available in the list. |
|
Sets the current index by using the given feature |
|
The display expression will be used to display features as well as the value to match the typed text against. |
|
Defines the feature request fetch limit If set to 0, no limit is applied when fetching |
|
An additional expression to further restrict the available features. |
|
Sets an attribute form feature to be used with the filter expression. |
|
Field name that will be used to uniquely identify the current feature. |
|
Field name that will be used to uniquely identify the current feature. |
|
The identifier value of the currently selected feature. |
|
The identifier values of the currently selected feature. |
|
Sets the identifier values of the currently selected feature to NULL |
|
Sets a parent attribute form feature to be used with the filter expression. |
|
The layer from which features should be listed. |
|
The layer from which features should be listed. |
Signals
Determines if a NULL value should be available in the list. |
|
Emitted when the current feature changes |
|
Emitted when the feature picker model changes its feature found state |
|
The display expression will be used to display features as well as the the value to match the typed text against. |
|
An additional expression to further restrict the available features. |
|
An attribute form feature to be used alongside the filter expression. |
|
Field name that will be used to uniquely identify the current feature. |
|
The identifier value of the currently selected feature. |
|
The underlying model has been updated. |
|
A parent attribute form feature to be used alongside the filter expression. |
|
The layer from which features should be listed. |
- class qgis.gui.QgsFeatureListComboBox[source]¶
Bases:
QComboBox
- __init__(parent: QWidget | None = None)
Create a new QgsFeatureListComboBox, optionally specifying a
parent
.- Parameters:
parent (Optional[QWidget] = None)
- allowNull(self) bool [source]¶
Determines if a NULL value should be available in the list.
- Return type:
bool
- signal currentFeatureChanged[source]¶
Emitted when the current feature changes
Added in version 3.16.5.
- signal currentFeatureFoundChanged(found: bool)[source]¶
Emitted when the feature picker model changes its feature
found
stateAdded in version 3.38.
- Parameters:
found (bool)
- currentFeatureRequest(self) QgsFeatureRequest [source]¶
Shorthand for getting a feature request to query the currently selected feature.
- Return type:
- currentModelIndex(self) QModelIndex [source]¶
The index of the currently selected item.
- Return type:
QModelIndex
- displayExpression(self) str [source]¶
The display expression will be used to display features as well as the value to match the typed text against.
- Return type:
str
- signal displayExpressionChanged[source]¶
The display expression will be used to display features as well as the the value to match the typed text against.
- fetchLimit(self) int [source]¶
Returns the feature request fetch limit
Added in version 3.32.
- Return type:
int
- filterExpression(self) str [source]¶
An additional expression to further restrict the available features. This can be used to integrate additional spatial or other constraints.
- Return type:
str
- signal filterExpressionChanged[source]¶
An additional expression to further restrict the available features. This can be used to integrate additional spatial or other constraints.
- formFeature(self) QgsFeature [source]¶
Returns an attribute form feature to be used with the filter expression.
Added in version 3.42.2.
- Return type:
- signal formFeatureChanged[source]¶
An attribute form feature to be used alongside the filter expression.
Added in version 3.42.2.
- identifierField(self) str [source]¶
Field name that will be used to uniquely identify the current feature. Normally the primary key of the layer.
Deprecated since version 3.10.
- Return type:
str
- signal identifierFieldChanged[source]¶
Field name that will be used to uniquely identify the current feature. Normally the primary key of the layer.
- identifierFields(self) List[str] [source]¶
Field name that will be used to uniquely identify the current feature. Normally the primary key of the layer.
Added in version 3.10.
- Return type:
List[str]
- identifierValue(self) Any [source]¶
The identifier value of the currently selected feature. A value from the identifierField.
Deprecated since version 3.10.
- Return type:
Any
- signal identifierValueChanged[source]¶
The identifier value of the currently selected feature. A value from the identifierField.
- identifierValues(self) List[Any] [source]¶
The identifier values of the currently selected feature. A value from the identifierField.
Added in version 3.10.
- Return type:
List[Any]
- nullIndex(self) int [source]¶
Returns the current index of the NULL value, or -1 if NULL values are not allowed.
Added in version 3.2.
- Return type:
int
- parentFormFeature(self) QgsFeature [source]¶
Returns a parent attribute form feature to be used with the filter expression.
Added in version 3.42.2.
- Return type:
- signal parentFormFeatureChanged[source]¶
A parent attribute form feature to be used alongside the filter expression.
Added in version 3.42.2.
- setAllowNull(self, allowNull: bool)[source]¶
Determines if a NULL value should be available in the list.
- Parameters:
allowNull (bool)
- setCurrentFeature(self, feature: QgsFeature)[source]¶
Sets the current index by using the given feature
Added in version 3.10.
- Parameters:
feature (QgsFeature)
- setDisplayExpression(self, displayExpression: str | None)[source]¶
The display expression will be used to display features as well as the value to match the typed text against.
- Parameters:
displayExpression (Optional[str])
- setFetchLimit(self, fetchLimit: int)[source]¶
Defines the feature request fetch limit If set to 0, no limit is applied when fetching
Added in version 3.32.
- Parameters:
fetchLimit (int)
- setFilterExpression(self, filterExpression: str | None)[source]¶
An additional expression to further restrict the available features. This can be used to integrate additional spatial or other constraints.
- Parameters:
filterExpression (Optional[str])
- setFormFeature(self, feature: QgsFeature)[source]¶
Sets an attribute form
feature
to be used with the filter expression.Added in version 3.42.2.
- Parameters:
feature (QgsFeature)
- setIdentifierField(self, identifierField: str | None)[source]¶
Field name that will be used to uniquely identify the current feature. Normally the primary key of the layer.
Deprecated since version 3.10.
- Parameters:
identifierField (Optional[str])
- setIdentifierFields(self, identifierFields: Iterable[str | None])[source]¶
Field name that will be used to uniquely identify the current feature. Normally the primary key of the layer.
Added in version 3.10.
- Parameters:
identifierFields (Iterable[Optional[str]])
- setIdentifierValue(self, identifierValue: Any)[source]¶
The identifier value of the currently selected feature. A value from the identifierField.
Deprecated since version 3.10: Use setIdentifierValues.
- Parameters:
identifierValue (Any)
- setIdentifierValues(self, identifierValues: Iterable[Any])[source]¶
The identifier values of the currently selected feature. A value from the identifierFields.
Added in version 3.10.
- Parameters:
identifierValues (Iterable[Any])
- setIdentifierValuesToNull(self)[source]¶
Sets the identifier values of the currently selected feature to NULL
- QgsFeatureListComboBox.setIdentifierValuesToNull(s).
setIdentifierValuesToNull(s).
Added in version 3.10.
- setParentFormFeature(self, feature: QgsFeature)[source]¶
Sets a parent attribute form
feature
to be used with the filter expression.Added in version 3.42.2.
- Parameters:
feature (QgsFeature)
- setSourceLayer(self, sourceLayer: QgsVectorLayer | None)[source]¶
The layer from which features should be listed.
- Parameters:
sourceLayer (Optional[QgsVectorLayer])
- sourceLayer(self) QgsVectorLayer | None [source]¶
The layer from which features should be listed.
- Return type:
Optional[QgsVectorLayer]