QGIS API Documentation
3.20.0-Odense (decaadbb31)
|
A tree based widget for editing expression context scope variables. More...
#include <qgsvariableeditorwidget.h>
Public Slots | |
void | reloadContext () |
Reloads all scopes from the editor's current context. More... | |
Signals | |
void | scopeChanged () |
Emitted when the user has modified a scope using the widget. More... | |
Public Member Functions | |
QgsVariableEditorWidget (QWidget *parent=nullptr) | |
Constructor for QgsVariableEditorWidget. More... | |
~QgsVariableEditorWidget () override | |
QgsExpressionContext * | context () const |
Returns the current expression context for the widget. More... | |
QgsExpressionContextScope * | editableScope () const |
Returns the current editable scope for the widget. More... | |
void | setContext (QgsExpressionContext *context) |
Overwrites the QgsExpressionContext for the widget. More... | |
void | setEditableScopeIndex (int scopeIndex) |
Sets the editable scope for the widget. More... | |
void | setSettingGroup (const QString &group) |
Sets the setting group for the widget. More... | |
QString | settingGroup () const |
Returns the setting group for the widget. More... | |
QVariantMap | variablesInActiveScope () const |
Returns a map variables set within the editable scope. More... | |
Protected Member Functions | |
void | showEvent (QShowEvent *event) override |
Properties | |
QString | settingGroup |
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.
Definition at line 42 of file qgsvariableeditorwidget.h.
QgsVariableEditorWidget::QgsVariableEditorWidget | ( | QWidget * | parent = nullptr | ) |
Constructor for QgsVariableEditorWidget.
parent | parent widget |
Definition at line 38 of file qgsvariableeditorwidget.cpp.
|
override |
Definition at line 73 of file qgsvariableeditorwidget.cpp.
|
inline |
Returns the current expression context for the widget.
QgsVariableEditorWidget widgets are created with an empty context by default.
Definition at line 72 of file qgsvariableeditorwidget.h.
QgsExpressionContextScope * QgsVariableEditorWidget::editableScope | ( | ) | const |
Returns the current editable scope for the widget.
nullptr
if no editable scope is set Definition at line 127 of file qgsvariableeditorwidget.cpp.
|
slot |
Reloads all scopes from the editor's current context.
This method should be called after adding or removing scopes from the attached context.
Definition at line 109 of file qgsvariableeditorwidget.cpp.
|
signal |
Emitted when the user has modified a scope using the widget.
void QgsVariableEditorWidget::setContext | ( | QgsExpressionContext * | context | ) |
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.
context | expression context |
Definition at line 103 of file qgsvariableeditorwidget.cpp.
void QgsVariableEditorWidget::setEditableScopeIndex | ( | int | scopeIndex | ) |
Sets the editable scope for the widget.
Only variables from the editable scope can be modified by users.
scopeIndex | index of current editable scope. Set to -1 to disable editing and make the widget read-only. |
Definition at line 116 of file qgsvariableeditorwidget.cpp.
|
inline |
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.
group | setting group |
Definition at line 97 of file qgsvariableeditorwidget.h.
|
inline |
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.
Definition at line 106 of file qgsvariableeditorwidget.h.
|
overrideprotected |
Definition at line 79 of file qgsvariableeditorwidget.cpp.
QVariantMap QgsVariableEditorWidget::variablesInActiveScope | ( | ) | const |
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.
Definition at line 136 of file qgsvariableeditorwidget.cpp.
|
readwrite |
Definition at line 1 of file qgsvariableeditorwidget.h.