QgsExpressionBuilderDialog class
A generic dialog for building expression strings.
Contents
- Reference
Public functions
- auto allowEvalErrors() const -> bool
- Allow accepting invalid expressions.
- auto expectedOutputFormat() -> QString
- Returns the expected format string, which is shown in the dialog.
- auto expressionBuilder() -> QgsExpressionBuilderWidget*
- The builder widget that is used by the dialog.
- auto expressionContext() const -> QgsExpressionContext
- Returns the expression context for the dialog.
- void setAllowEvalErrors(bool allowEvalErrors)
- Allow accepting expressions with evaluation errors.
- void setExpectedOutputFormat(const QString& expected)
- Set the expected format string, which is shown in the dialog.
- void setExpressionContext(const QgsExpressionContext& context)
- Sets the expression context for the dialog.
- void setGeomCalculator(const QgsDistanceArea& da)
- Sets geometry calculator used in distance/area calculations.
Signals
- void allowEvalErrorsChanged()
- Allow accepting expressions with evaluation errors.
Protected functions
- void done(int r) override
- Is called when the dialog get accepted or rejected Used to save geometry.
Function documentation
bool QgsExpressionBuilderDialog:: allowEvalErrors() const
Allow accepting invalid expressions.
This can be useful when we are not able to provide an expression context of which we are sure it's completely populated.
QString QgsExpressionBuilderDialog:: expectedOutputFormat()
Returns the expected format string, which is shown in the dialog.
This is purely a text format and no expression validation is done against it.
QgsExpressionContext QgsExpressionBuilderDialog:: expressionContext() const
Returns the expression context for the dialog.
The context is used for the expression preview result and for populating the list of available functions and variables.
void QgsExpressionBuilderDialog:: setAllowEvalErrors(bool allowEvalErrors)
Allow accepting expressions with evaluation errors.
This can be useful when we are not able to provide an expression context of which we are sure it's completely populated.
void QgsExpressionBuilderDialog:: setExpectedOutputFormat(const QString& expected)
Set the expected format string, which is shown in the dialog.
This is purely a text format and no expression validation is done against it.
void QgsExpressionBuilderDialog:: setExpressionContext(const QgsExpressionContext& context)
Sets the expression context for the dialog.
| Parameters | |
|---|---|
| context | expression context |
The context is used for the expression preview result and for populating the list of available functions and variables.
void QgsExpressionBuilderDialog:: allowEvalErrorsChanged() signal
Allow accepting expressions with evaluation errors.
This can be useful when we are not able to provide an expression context of which we are sure it's completely populated.
void QgsExpressionBuilderDialog:: done(int r) override protected
Is called when the dialog get accepted or rejected Used to save geometry.
| Parameters | |
|---|---|
| r | result value (unused) |