Class: QgsVariableEditorWidget¶
-
class
qgis.gui.
QgsVariableEditorWidget
(parent: QWidget = None)¶ Bases:
PyQt5.QtWidgets.QWidget
Constructor for QgsVariableEditorWidget.
- Parameters
parent – 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.
New in version 2.12: Enums
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.
Returns a map variables set within the editable scope.
Signals
Emitted when the user has modified a scope using the widget.
Attributes
-
actionEvent
()¶
-
changeEvent
()¶
-
childEvent
()¶
-
closeEvent
()¶
-
connectNotify
()¶
-
context
(self) → QgsExpressionContext¶ Returns the current expression context for the widget. QgsVariableEditorWidget widgets are created with an empty context by default.
See also
-
contextMenuEvent
()¶
-
create
()¶
-
customEvent
()¶
-
destroy
()¶
-
disconnectNotify
()¶
-
dragEnterEvent
()¶
-
dragLeaveEvent
()¶
-
dragMoveEvent
()¶
-
dropEvent
()¶
-
editableScope
(self) → QgsExpressionContextScope¶ Returns the current editable scope for the widget.
- Returns
editable scope, or None if no editable scope is set
See also
-
enterEvent
()¶
-
event
()¶
-
focusInEvent
()¶
-
focusNextChild
()¶
-
focusNextPrevChild
()¶
-
focusOutEvent
()¶
-
focusPreviousChild
()¶
-
hideEvent
()¶
-
initPainter
()¶
-
inputMethodEvent
()¶
-
isSignalConnected
()¶
-
keyPressEvent
()¶
-
keyReleaseEvent
()¶
-
leaveEvent
()¶
-
metric
()¶
-
mouseDoubleClickEvent
()¶
-
mouseMoveEvent
()¶
-
mousePressEvent
()¶
-
mouseReleaseEvent
()¶
-
moveEvent
()¶
-
nativeEvent
()¶
-
paintEvent
()¶
-
receivers
()¶
-
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
()¶
-
scopeChanged
¶ Emitted when the user has modified a scope using the widget. [signal]
-
sender
()¶
-
senderSignalIndex
()¶
-
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 – 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 – 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 – 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.
- Returns
setting group name
See also
-
showEvent
(self, event: QShowEvent)¶
-
tabletEvent
()¶
-
timerEvent
()¶
-
updateMicroFocus
()¶
-
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.
-
wheelEvent
()¶