QgsExpressionTreeView is a tree view to list all expressions functions, variables and fields that can be used in an expression.
More...
#include <qgsexpressiontreeview.h>
QgsExpressionTreeView is a tree view to list all expressions functions, variables and fields that can be used in an expression.
- See also
- QgsExpressionBuilderWidget
- Since
- QGIS 3.14
Definition at line 150 of file qgsexpressiontreeview.h.
◆ QgsExpressionTreeView()
QgsExpressionTreeView::QgsExpressionTreeView |
( |
QWidget * |
parent = nullptr | ) |
|
◆ currentExpressionItemChanged
Emitter when the current expression item changed.
◆ currentItem()
◆ exportUserExpressions()
QJsonDocument QgsExpressionTreeView::exportUserExpressions |
( |
| ) |
|
Create the expressions JSON document storing all the user expressions to be exported.
- Returns
- the created expressions JSON file
Definition at line 611 of file qgsexpressiontreeview.cpp.
◆ expressionContext()
Returns the expression context for the widget.
The context is used for the expression preview result and for populating the list of available functions and variables.
- See also
- setExpressionContext
Definition at line 199 of file qgsexpressiontreeview.h.
◆ expressionItemDoubleClicked
void QgsExpressionTreeView::expressionItemDoubleClicked |
( |
const QString & |
text | ) |
|
|
signal |
Emitted when a expression item is double clicked.
◆ findExpressions()
const QList< QgsExpressionItem * > QgsExpressionTreeView::findExpressions |
( |
const QString & |
label | ) |
|
◆ loadExpressionsFromJson()
void QgsExpressionTreeView::loadExpressionsFromJson |
( |
const QJsonDocument & |
expressionsDocument | ) |
|
Load and permanently store the expressions from the expressions JSON document.
- Parameters
-
expressionsDocument | the parsed expressions JSON file |
Definition at line 653 of file qgsexpressiontreeview.cpp.
◆ loadFieldNames()
void QgsExpressionTreeView::loadFieldNames |
( |
const QgsFields & |
fields | ) |
|
◆ loadRecent()
void QgsExpressionTreeView::loadRecent |
( |
const QString & |
collection = QStringLiteral( "generic" ) | ) |
|
Loads the recent expressions from the given collection.
By default it is loaded from the collection "generic".
Definition at line 513 of file qgsexpressiontreeview.cpp.
◆ loadUserExpressions()
void QgsExpressionTreeView::loadUserExpressions |
( |
| ) |
|
Loads the user expressions.
This is done on request since it can be very slow if there are thousands of user expressions
Definition at line 580 of file qgsexpressiontreeview.cpp.
◆ model()
QStandardItemModel * QgsExpressionTreeView::model |
( |
| ) |
|
Returns a pointer to the dialog's function item model.
This method is exposed for testing purposes only - it should not be used to modify the model
- Note
- will be removed in QGIS 4
- Deprecated:
- since QGIS 3.14
Definition at line 178 of file qgsexpressiontreeview.cpp.
◆ project()
◆ refresh()
void QgsExpressionTreeView::refresh |
( |
| ) |
|
◆ removeFromUserExpressions()
void QgsExpressionTreeView::removeFromUserExpressions |
( |
const QString & |
label | ) |
|
◆ saveToRecent()
void QgsExpressionTreeView::saveToRecent |
( |
const QString & |
expressionText, |
|
|
const QString & |
collection = "generic" |
|
) |
| |
Adds the current expression to the given collection.
By default it is saved to the collection "generic".
Definition at line 537 of file qgsexpressiontreeview.cpp.
◆ saveToUserExpressions()
void QgsExpressionTreeView::saveToUserExpressions |
( |
const QString & |
label, |
|
|
const QString & |
expression, |
|
|
const QString & |
helpText |
|
) |
| |
◆ setExpressionContext()
Sets the expression context for the tree view.
The context is used to populate the list of available functions and variables.
- Parameters
-
context | expression context |
- See also
- expressionContext
Definition at line 149 of file qgsexpressiontreeview.cpp.
◆ setLayer()
◆ setMenuProvider()
◆ setProject()
void QgsExpressionTreeView::setProject |
( |
QgsProject * |
project | ) |
|
Sets the project currently associated with the widget.
This controls which layers and relations and other project-specific items are shown in the widget.
- See also
- project()
Definition at line 188 of file qgsexpressiontreeview.cpp.
◆ setSearchText
void QgsExpressionTreeView::setSearchText |
( |
const QString & |
text | ) |
|
|
slot |
◆ userExpressionLabels()
QStringList QgsExpressionTreeView::userExpressionLabels |
( |
| ) |
const |
The documentation for this class was generated from the following files: