Class: QgsEditorConfigWidget¶
Base class for widgets which configure editor widget types.
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}
Note
This is an abstract class, with methods which must be implemented by a subclass.
The following methods must be implemented: config(), setConfig()
Class Hierarchy¶
Base classes¶
Abstract interface for generating an expression context. |
- 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
- signal changed[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- abstract 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
- abstract 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
buttonto reflect the widgets’s current properties.- Parameters:
button (Optional[QgsPropertyOverrideButton])