Class: QgsEditorConfigWidget¶
- class qgis.gui.QgsEditorConfigWidget¶
Bases:
PyQt5.QtWidgets.QWidget
,QgsExpressionContextGenerator
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
}QgsEditorConfigWidget(vl:
QgsVectorLayer
, fieldIdx: int, parent: QWidget) Create a new configuration widget- Parameters
vl – The layer for which the configuration dialog will be created
fieldIdx – The index of the field on the layer for which this dialog will be created
parent –
A parent widget
Methods
Create a configuration from the current GUI state
- rtype
QgsExpressionContext
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.
- actionEvent(self, QActionEvent)¶
- changeEvent(self, QEvent)¶
- changed¶
Emitted when the configuration of the widget is changed.
New in version 3.0: [signal]
- childEvent(self, QChildEvent)¶
- closeEvent(self, QCloseEvent)¶
- config(self) Dict[str, Any] ¶
Create a configuration from the current GUI state
- Return type
Dict[str, Any]
- Returns
A widget configuration
- connectNotify(self, QMetaMethod)¶
- contextMenuEvent(self, QContextMenuEvent)¶
- create(self, window: sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- createExpressionContext(self) QgsExpressionContext ¶
- Return type
- customEvent(self, QEvent)¶
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- disconnectNotify(self, QMetaMethod)¶
- dragEnterEvent(self, QDragEnterEvent)¶
- dragLeaveEvent(self, QDragLeaveEvent)¶
- dragMoveEvent(self, QDragMoveEvent)¶
- dropEvent(self, QDropEvent)¶
- enterEvent(self, QEvent)¶
- event(self, QEvent) bool ¶
- field(self) int ¶
Returns the field for which this configuration widget applies
- Return type
int
- Returns
The field index
- focusInEvent(self, QFocusEvent)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, bool) bool ¶
- focusOutEvent(self, QFocusEvent)¶
- focusPreviousChild(self) bool ¶
- hideEvent(self, QHideEvent)¶
- initPainter(self, QPainter)¶
- initializeDataDefinedButton(self, button: QgsPropertyOverrideButton, key: QgsWidgetWrapper.Property)¶
Registers a property override button, setting up its initial value, connections and description.
- Parameters
button (QgsPropertyOverrideButton) – button to register
key (QgsWidgetWrapper.Property) – corresponding data defined property key
- inputMethodEvent(self, QInputMethodEvent)¶
- isSignalConnected(self, QMetaMethod) bool ¶
- keyPressEvent(self, QKeyEvent)¶
- keyReleaseEvent(self, QKeyEvent)¶
- layer(self) QgsVectorLayer ¶
Returns the layer for which this configuration widget applies
- Return type
- Returns
The layer
- leaveEvent(self, QEvent)¶
- metric(self, QPaintDevice.PaintDeviceMetric) int ¶
- mouseDoubleClickEvent(self, QMouseEvent)¶
- mouseMoveEvent(self, QMouseEvent)¶
- mousePressEvent(self, QMouseEvent)¶
- mouseReleaseEvent(self, QMouseEvent)¶
- moveEvent(self, QMoveEvent)¶
- nativeEvent(self, Union[QByteArray, bytes, bytearray], sip.voidptr) Tuple[bool, int] ¶
- paintEvent(self, QPaintEvent)¶
- receivers(self, PYQT_SIGNAL) int ¶
- resizeEvent(self, QResizeEvent)¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setConfig(self, config: Dict[str, Any])¶
Update the configuration widget to represent the given configuration.
- Parameters
config (Dict[str) – The configuration which should be represented by this widget
- showEvent(self, QShowEvent)¶
- tabletEvent(self, QTabletEvent)¶
- timerEvent(self, QTimerEvent)¶
- updateDataDefinedButton(self, button: QgsPropertyOverrideButton)¶
Updates a specific property override
button
to reflect the widgets’s current properties.- Parameters
button (QgsPropertyOverrideButton) –
- updateDataDefinedButtons(self)¶
Updates all property override buttons to reflect the widgets’s current properties.
- updateMicroFocus(self)¶
- wheelEvent(self, QWheelEvent)¶