QGIS API Documentation 3.41.0-Master (3440c17df1d)
|
A generic dialog for building expression strings. More...
#include <qgsexpressionbuilderdialog.h>
Signals | |
void | allowEvalErrorsChanged () |
Allow accepting expressions with evaluation errors. | |
Public Member Functions | |
QgsExpressionBuilderDialog (QgsVectorLayer *layer, const QString &startText=QString(), QWidget *parent SIP_TRANSFERTHIS=nullptr, const QString &key="generic", const QgsExpressionContext &context=QgsExpressionContext()) | |
bool | allowEvalErrors () const |
Allow accepting invalid expressions. | |
QString | expectedOutputFormat () |
Returns the expected format string, which is shown in the dialog. | |
QgsExpressionBuilderWidget * | expressionBuilder () |
The builder widget that is used by the dialog. | |
QgsExpressionContext | expressionContext () const |
Returns the expression context for the dialog. | |
QString | expressionText () |
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 | setExpressionText (const QString &text) |
void | setGeomCalculator (const QgsDistanceArea &da) |
Sets geometry calculator used in distance/area calculations. | |
Protected Member Functions | |
void | accept () override |
void | done (int r) override |
Is called when the dialog get accepted or rejected Used to save geometry. | |
void | reject () override |
Properties | |
bool | allowEvalErrors |
A generic dialog for building expression strings.
Definition at line 29 of file qgsexpressionbuilderdialog.h.
QgsExpressionBuilderDialog::QgsExpressionBuilderDialog | ( | QgsVectorLayer * | layer, |
const QString & | startText = QString() , |
||
QWidget *parent | SIP_TRANSFERTHIS = nullptr , |
||
const QString & | key = "generic" , |
||
const QgsExpressionContext & | context = QgsExpressionContext() |
||
) |
Definition at line 23 of file qgsexpressionbuilderdialog.cpp.
|
overrideprotected |
Definition at line 84 of file qgsexpressionbuilderdialog.cpp.
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.
Definition at line 131 of file qgsexpressionbuilderdialog.cpp.
|
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.
|
overrideprotected |
Is called when the dialog get accepted or rejected Used to save geometry.
r | result value (unused) |
Definition at line 79 of file qgsexpressionbuilderdialog.cpp.
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.
Definition at line 59 of file qgsexpressionbuilderdialog.cpp.
QgsExpressionBuilderWidget * QgsExpressionBuilderDialog::expressionBuilder | ( | ) |
The builder widget that is used by the dialog.
Definition at line 44 of file qgsexpressionbuilderdialog.cpp.
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.
Definition at line 69 of file qgsexpressionbuilderdialog.cpp.
QString QgsExpressionBuilderDialog::expressionText | ( | ) |
Definition at line 54 of file qgsexpressionbuilderdialog.cpp.
|
overrideprotected |
Definition at line 90 of file qgsexpressionbuilderdialog.cpp.
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.
Definition at line 136 of file qgsexpressionbuilderdialog.cpp.
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.
Definition at line 64 of file qgsexpressionbuilderdialog.cpp.
void QgsExpressionBuilderDialog::setExpressionContext | ( | const QgsExpressionContext & | context | ) |
Sets 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.
context | expression context |
Definition at line 74 of file qgsexpressionbuilderdialog.cpp.
void QgsExpressionBuilderDialog::setExpressionText | ( | const QString & | text | ) |
Definition at line 49 of file qgsexpressionbuilderdialog.cpp.
void QgsExpressionBuilderDialog::setGeomCalculator | ( | const QgsDistanceArea & | da | ) |
Sets geometry calculator used in distance/area calculations.
Definition at line 125 of file qgsexpressionbuilderdialog.cpp.
|
readwrite |
Definition at line 33 of file qgsexpressionbuilderdialog.h.