Class: QgsExpressionBuilderDialog¶
A generic dialog for building expression strings.
Class Hierarchy¶
Base classes¶
Methods
Allow accepting invalid expressions. |
|
Returns the expected format string, which is shown in the dialog. |
|
The builder widget that is used by the dialog |
|
Returns the expression context for the dialog. |
|
Allow accepting expressions with evaluation errors. |
|
Set the expected format string, which is shown in the dialog. |
|
Sets the expression context for the dialog. |
|
Sets geometry calculator used in distance/area calculations. |
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsExpressionBuilderDialog. See the FAQ for more details.
Is called when the dialog get accepted or rejected Used to save geometry |
Signals
Allow accepting expressions with evaluation errors. |
- class qgis.gui.QgsExpressionBuilderDialog[source]¶
Bases:
QDialog
- allowEvalErrors(self) bool [source]¶
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.
- Return type:
bool
- signal allowEvalErrorsChanged[source]¶
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.
- virtual done(self, r: int)[source]¶
Is called when the dialog get accepted or rejected Used to save geometry
- Parameters:
r (int) – result value (unused)
- expectedOutputFormat(self) str [source]¶
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.
See also
- Return type:
str
- expressionBuilder(self) QgsExpressionBuilderWidget | None [source]¶
The builder widget that is used by the dialog
- Return type:
Optional[QgsExpressionBuilderWidget]
- expressionContext(self) QgsExpressionContext [source]¶
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.
See also
- Return type:
- setAllowEvalErrors(self, allowEvalErrors: bool)[source]¶
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.
- Parameters:
allowEvalErrors (bool)
- setExpectedOutputFormat(self, expected: str | None)[source]¶
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.See also
- Parameters:
expected (Optional[str])
- setExpressionContext(self, context: QgsExpressionContext)[source]¶
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.
- Parameters:
context (QgsExpressionContext) – expression context
See also
- setGeomCalculator(self, da: QgsDistanceArea)[source]¶
Sets geometry calculator used in distance/area calculations.
- Parameters:
da (QgsDistanceArea)