Class: QgsEditorConfigWidget¶
This class should be subclassed for every configurable editor widget type.
It implements the GUI configuration widget and transforms this to/from a configuration.
It will only be instantiated by {QgsEditorWidgetFactory
}
Class Hierarchy¶
Base classes¶
Abstract interface for generating an expression context. |
Methods
Create a configuration from the current GUI state |
|
Returns the field for which this configuration widget applies |
|
Registers a property override button, setting up its initial value, connections and description. |
|
Returns the layer for which this configuration widget applies |
|
Update the configuration widget to represent the given configuration. |
|
Updates a specific property override button to reflect the widgets's current properties. |
|
Updates all property override buttons to reflect the widgets's current properties. |
Signals
Emitted when the configuration of the widget is changed. |
- class qgis.gui.QgsEditorConfigWidget[source]¶
Bases:
QWidget
,QgsExpressionContextGenerator
- __init__(vl: QgsVectorLayer | None, fieldIdx: int, parent: QWidget | None)
Create a new configuration widget
- Parameters:
vl (Optional[QgsVectorLayer]) – The layer for which the configuration dialog will be created
fieldIdx (int) – The index of the field on the layer for which this dialog will be created
parent (Optional[QWidget]) – A parent widget
- config(self) Dict[str, Any] [source]¶
Create a configuration from the current GUI state
- Return type:
Dict[str, Any]
- Returns:
A widget configuration
- field(self) int [source]¶
Returns the field for which this configuration widget applies
- Return type:
int
- Returns:
The field index
- initializeDataDefinedButton(self, button: QgsPropertyOverrideButton | None, key: QgsWidgetWrapper.Property)[source]¶
Registers a property override button, setting up its initial value, connections and description.
- Parameters:
button (Optional[QgsPropertyOverrideButton]) – button to register
key (QgsWidgetWrapper.Property) – corresponding data defined property key
- layer(self) QgsVectorLayer | None [source]¶
Returns the layer for which this configuration widget applies
- Return type:
Optional[QgsVectorLayer]
- Returns:
The layer
- setConfig(self, config: Dict[str, Any])[source]¶
Update the configuration widget to represent the given configuration.
- Parameters:
config (Dict[str, Any]) – The configuration which should be represented by this widget
- updateDataDefinedButton(self, button: QgsPropertyOverrideButton | None)[source]¶
Updates a specific property override
button
to reflect the widgets’s current properties.- Parameters:
button (Optional[QgsPropertyOverrideButton])