Class: QgsVariableEditorWidget¶
-
class
qgis.gui.
QgsVariableEditorWidget
(parent: QWidget = None)¶ Bases:
PyQt5.QtWidgets.QWidget
Constructor for QgsVariableEditorWidget.
- Parameters
parent (QWidget = None) – parent widget
A tree based widget for editing expression context scope variables. The widget allows editing variables from a
QgsExpressionContextScope
, and can optionally also show inherited variables from a QgsExpressionContext.Methods
Returns the current expression context for the widget.
Returns the current editable scope for the widget.
Reloads all scopes from the editor’s current context.
Overwrites the
QgsExpressionContext
for the widget.Sets the editable scope for the widget.
Sets the setting group for the widget.
Returns the setting group for the widget.
- param event
Returns a map variables set within the editable scope.
Signals
Emitted when the user has modified a scope using the widget.
-
actionEvent
(self, QActionEvent)¶
-
changeEvent
(self, QEvent)¶
-
childEvent
(self, QChildEvent)¶
-
closeEvent
(self, QCloseEvent)¶
-
connectNotify
(self, QMetaMethod)¶
-
context
(self) → QgsExpressionContext¶ Returns the current expression context for the widget.
QgsVariableEditorWidget
widgets are created with an empty context by default.See also
- Return type
-
contextMenuEvent
(self, QContextMenuEvent)¶
-
create
(self, window: sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
-
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)¶
-
editableScope
(self) → QgsExpressionContextScope¶ Returns the current editable scope for the widget.
- Return type
- Returns
editable scope, or
None
if no editable scope is set
See also
-
enterEvent
(self, QEvent)¶
-
event
(self, QEvent) → bool¶
-
focusInEvent
(self, QFocusEvent)¶
-
focusNextChild
(self) → bool¶
-
focusNextPrevChild
(self, bool) → bool¶
-
focusOutEvent
(self, QFocusEvent)¶
-
focusPreviousChild
(self) → bool¶
-
hideEvent
(self, QHideEvent)¶
-
initPainter
(self, QPainter)¶
-
inputMethodEvent
(self, QInputMethodEvent)¶
-
isSignalConnected
(self, QMetaMethod) → bool¶
-
keyPressEvent
(self, QKeyEvent)¶
-
keyReleaseEvent
(self, QKeyEvent)¶
-
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¶
-
reloadContext
(self)¶ Reloads all scopes from the editor’s current context. This method should be called after adding or removing scopes from the attached context.
See also
-
resizeEvent
(self, QResizeEvent)¶
-
scopeChanged
¶ Emitted when the user has modified a scope using the widget. [signal]
-
sender
(self) → QObject¶
-
senderSignalIndex
(self) → int¶
-
setContext
(self, context: QgsExpressionContext)¶ Overwrites the
QgsExpressionContext
for the widget. Setting a context allows the widget to show all inherited variables for the context, and highlight any overridden variables within scopes.- Parameters
context (QgsExpressionContext) – expression context
See also
-
setEditableScopeIndex
(self, scopeIndex: int)¶ Sets the editable scope for the widget. Only variables from the editable scope can be modified by users.
- Parameters
scopeIndex (int) – index of current editable scope. Set to -1 to disable editing and make the widget read-only.
See also
-
setSettingGroup
(self, group: str)¶ Sets the setting group for the widget.
QgsVariableEditorWidget
widgets with the same setting group will synchronise their settings, e.g., the size of columns in the tree widget.- Parameters
group (str) – setting group
See also
-
settingGroup
(self) → str¶ Returns the setting group for the widget.
QgsVariableEditorWidget
widgets with the same setting group will synchronise their settings, e.g., the size of columns in the tree widget.- Return type
str
- Returns
setting group name
See also
-
showEvent
(self, event: QShowEvent)¶ - Parameters
event (QShowEvent) –
-
tabletEvent
(self, QTabletEvent)¶
-
timerEvent
(self, QTimerEvent)¶
-
updateMicroFocus
(self)¶
-
variablesInActiveScope
(self) → Dict[str, Any]¶ Returns a map variables set within the editable scope. Read only variables are not returned. This method can be used to retrieve the variables edited an added by users via the widget.
- Return type
Dict[str, Any]
-
wheelEvent
(self, QWheelEvent)¶