Class: QgsFieldValuesLineEdit¶
A line edit with an autocompleter which takes unique values from a vector layer’s fields.
The autocompleter is populated from the vector layer in the background to ensure responsive interaction with the widget.
Class Hierarchy¶
Base classes¶
QLineEdit subclass with built in support for clearing the widget’s value and handling custom null value representations. |
|
Methods
Returns the attribute index for the field containing values shown in the widget. |
|
Returns the layer containing the field that values will be shown from. |
|
Sets the attribute index for the field containing values to show in the widget. |
|
Sets the layer containing the field that values will be shown from. |
Signals
Emitted when the field associated with the widget changes. |
|
Emitted when the layer associated with the widget changes. |
- class qgis.gui.QgsFieldValuesLineEdit[source]¶
Bases:
QgsFilterLineEdit
- __init__(parent: QWidget | None = None)
Constructor for QgsFieldValuesLineEdit
- Parameters:
parent (Optional[QWidget] = None) – parent widget
- attributeIndex(self) int [source]¶
Returns the attribute index for the field containing values shown in the widget.
See also
See also
- Return type:
int
- signal attributeIndexChanged(index: int)[source]¶
Emitted when the field associated with the widget changes.
- Parameters:
index (int) – new attribute index for field
- layer(self) QgsVectorLayer | None [source]¶
Returns the layer containing the field that values will be shown from.
See also
See also
- Return type:
Optional[QgsVectorLayer]
- signal layerChanged(layer: QgsVectorLayer)[source]¶
Emitted when the layer associated with the widget changes.
- Parameters:
layer (QgsVectorLayer) – vector layer
- setAttributeIndex(self, index: int)[source]¶
Sets the attribute index for the field containing values to show in the widget.
- Parameters:
index (int) – index of attribute
See also
See also
- setLayer(self, layer: QgsVectorLayer | None)[source]¶
Sets the layer containing the field that values will be shown from.
- Parameters:
layer (Optional[QgsVectorLayer]) – vector layer
See also
See also