QGIS API Documentation
3.18.1-Zürich (202f1bf7e5)
|
QgsExpressionPreviewWidget is a widget to preview an expression result. More...
#include <qgsexpressionpreviewwidget.h>
Public Slots | |
void | setCurrentFeature (const QgsFeature &feature) |
sets the current feature used More... | |
Signals | |
void | evalErrorChanged () |
Will be set to true if the current expression text reported an eval error with the context. More... | |
void | expressionParsed (bool isValid) |
Emitted when the user changes the expression in the widget. More... | |
void | parserErrorChanged () |
Will be set to true if the current expression text reported a parser error with the context. More... | |
void | toolTipChanged (const QString &toolTip) |
Emitted whenever the tool tip changed. More... | |
Public Member Functions | |
QgsExpressionPreviewWidget (QWidget *parent=nullptr) | |
Constructor. More... | |
bool | evalError () const |
Will be set to true if the current expression text reported an eval error with the context. More... | |
QgsExpressionContext | expressionContext () const |
Returns the expression context for the widget. More... | |
bool | parserError () const |
Will be set to true if the current expression text reports a parser error with the context. More... | |
QList< QgsExpression::ParserError > | parserErrors () const |
Returns the expression parser erros. More... | |
const QgsExpressionNode * | rootNode () const |
Returns the root node of the expression. More... | |
void | setExpressionContext (const QgsExpressionContext &context) |
Sets the expression context for the widget. More... | |
void | setExpressionText (const QString &expression) |
Sets the expression. More... | |
void | setGeomCalculator (const QgsDistanceArea &da) |
Sets geometry calculator used in distance/area calculations. More... | |
void | setLayer (QgsVectorLayer *layer) |
Sets the layer used in the preview. More... | |
QgsExpressionPreviewWidget is a widget to preview an expression result.
If the layer is set, one can browse across features to see the different outputs.
Definition at line 35 of file qgsexpressionpreviewwidget.h.
|
explicit |
Constructor.
Definition at line 25 of file qgsexpressionpreviewwidget.cpp.
bool QgsExpressionPreviewWidget::evalError | ( | ) | const |
Will be set to true
if the current expression text reported an eval error with the context.
Definition at line 180 of file qgsexpressionpreviewwidget.cpp.
|
signal |
Will be set to true
if the current expression text reported an eval error with the context.
|
inline |
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.
Definition at line 53 of file qgsexpressionpreviewwidget.h.
|
signal |
Emitted when the user changes the expression in the widget.
Users of this widget should connect to this signal to decide if to let the user continue.
isValid | Is true if the expression the user has typed is valid. |
bool QgsExpressionPreviewWidget::parserError | ( | ) | const |
Will be set to true
if the current expression text reports a parser error with the context.
Definition at line 166 of file qgsexpressionpreviewwidget.cpp.
|
signal |
Will be set to true
if the current expression text reported a parser error with the context.
|
inline |
Returns the expression parser erros.
Definition at line 81 of file qgsexpressionpreviewwidget.h.
|
inline |
Returns the root node of the expression.
Definition at line 78 of file qgsexpressionpreviewwidget.h.
|
slot |
sets the current feature used
Definition at line 48 of file qgsexpressionpreviewwidget.cpp.
void QgsExpressionPreviewWidget::setExpressionContext | ( | const QgsExpressionContext & | context | ) |
Sets the expression context for the widget.
The context is used for the expression preview result and to populate the list of available functions and variables.
context | expression context |
Definition at line 62 of file qgsexpressionpreviewwidget.cpp.
void QgsExpressionPreviewWidget::setExpressionText | ( | const QString & | expression | ) |
Sets the expression.
Definition at line 42 of file qgsexpressionpreviewwidget.cpp.
void QgsExpressionPreviewWidget::setGeomCalculator | ( | const QgsDistanceArea & | da | ) |
Sets geometry calculator used in distance/area calculations.
Definition at line 56 of file qgsexpressionpreviewwidget.cpp.
void QgsExpressionPreviewWidget::setLayer | ( | QgsVectorLayer * | layer | ) |
Sets the layer used in the preview.
Definition at line 36 of file qgsexpressionpreviewwidget.cpp.
|
signal |
Emitted whenever the tool tip changed.