Class: QgsFeaturePickerWidget¶
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.
Added in version 3.14.
Class Hierarchy¶
Base classes¶
Methods
Determines if a NULL value should be available in the list. |
|
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 current feature |
|
Returns if the geometry is fetched |
|
Returns the feature request fetch limit |
|
An additional expression to further restrict the available features. |
|
The layer from which features should be listed. |
|
Returns the current index of the NULL value, or -1 if NULL values are not allowed. |
|
Determines if a NULL value should be available in the list. |
|
The display expression will be used to display features as well as the value to match the typed text against. |
|
Sets the current index by using the given feature |
|
Defines if the geometry will be fetched |
|
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. |
|
The layer from which features should be listed. |
|
Defines if the browsing buttons are shown |
|
Returns if the browsing buttons are shown |
Signals
Determines if a NULL value should be available in the list. |
|
The display expression will be used to display features as well as the the value to match the typed text against. |
|
Sends the feature as soon as it is chosen |
|
Emitted when the fetching of the geometry changes |
|
Emitted when the fetching limit for the feature request changes |
|
An additional expression to further restrict the available features. |
|
The layer from which features should be listed. |
|
The underlying model has been updated. |
|
Emitted when showing the browser buttons changes |
- class qgis.gui.QgsFeaturePickerWidget[source]¶
Bases:
QWidget
- __init__(parent: QWidget | None = None)
Create a new QgsFeaturePickerWidget, 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
- 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.
- feature(self) QgsFeature [source]¶
Returns the current feature
- Return type:
- signal featureChanged(feature: QgsFeature)[source]¶
Sends the feature as soon as it is chosen
- Parameters:
feature (QgsFeature)
- 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.
- layer(self) QgsVectorLayer | None [source]¶
The layer from which features should be listed.
- Return type:
Optional[QgsVectorLayer]
- nullIndex(self) int [source]¶
Returns the current index of the NULL value, or -1 if NULL values are not allowed.
- Return type:
int
- setAllowNull(self, allowNull: bool)[source]¶
Determines if a NULL value should be available in the list.
- Parameters:
allowNull (bool)
- 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])
- setFeature(self, featureId: int)[source]¶
Sets the current index by using the given feature
- Parameters:
featureId (int)
- setFetchGeometry(self, fetchGeometry: bool)[source]¶
Defines if the geometry will be fetched
- Parameters:
fetchGeometry (bool)
- setFetchLimit(self, fetchLimit: int)[source]¶
Defines the feature request fetch limit If set to 0, no limit is applied when fetching
- 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])
- setLayer(self, layer: QgsVectorLayer | None)[source]¶
The layer from which features should be listed.
- Parameters:
layer (Optional[QgsVectorLayer])