Class: QgsExpressionNodeCondition¶
An expression node for CASE WHEN clauses.
List of all members, including inherited members
Class Hierarchy¶
Base classes¶
Abstract base class for all nodes that can appear in an expression. |
Constructor
Classes
Represents a "WHEN. |
Abstract Methods
Methods
The list of WHEN THEN expression parts of the expression. |
|
The ELSE expression used for the condition. |
Virtual Methods
In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsExpressionNodeCondition. See the FAQ for more details.
- class qgis.core.QgsExpressionNodeCondition[source]¶
Bases:
QgsExpressionNode- __init__(conditions: Iterable[QgsExpressionNodeCondition.WhenThen], elseExp: QgsExpressionNode | None = None)¶
Create a new node with the given list of
conditionsand an optionalelseExpexpression.- Parameters:
conditions (Iterable[QgsExpressionNodeCondition.WhenThen])
elseExp (QgsExpressionNode|None = None)
- class WhenThen[source]¶
Bases:
objectRepresents a “WHEN… THEN…” portation of a CASE WHEN clause in an expression.
- __init__(whenExp: QgsExpressionNode | None, thenExp: QgsExpressionNode | None)¶
A combination of when and then. Simple as that.
- Parameters:
whenExp (QgsExpressionNode|None)
thenExp (QgsExpressionNode|None)
- clone(self) QgsExpressionNodeCondition.WhenThen | None¶
Gets a deep copy of this WhenThen combination.
- Return type:
- thenExp(self) QgsExpressionNode | None[source]¶
The expression node that makes the THEN result part of the condition.
- Return type:
QgsExpressionNode|None
- Returns:
The expression node that makes the THEN result part of the condition.
- whenExp(self) QgsExpressionNode | None[source]¶
The expression that makes the WHEN part of the condition.
- Return type:
QgsExpressionNode|None
- Returns:
The expression node that makes the WHEN part of the condition check.
- abstract clone(self) QgsExpressionNode | None[source]¶
- Return type:
QgsExpressionNode|None
- conditions(self) list[QgsExpressionNodeCondition.WhenThen][source]¶
The list of WHEN THEN expression parts of the expression.
- Return type:
- Returns:
The list of WHEN THEN expression parts of the expression.
- elseExp(self) QgsExpressionNode | None[source]¶
The ELSE expression used for the condition.
- Return type:
QgsExpressionNode|None
- Returns:
The ELSE expression used for the condition.
- virtual evalNode(self, parent: QgsExpression | None, context: QgsExpressionContext | None) Any[source]¶
- Parameters:
parent (QgsExpression|None)
context (QgsExpressionContext|None)
- Return type:
- virtual prepareNode(self, parent: QgsExpression | None, context: QgsExpressionContext | None) bool[source]¶
- Parameters:
parent (QgsExpression|None)
context (QgsExpressionContext|None)
- Return type:
bool
- virtual simplifiedNode(self) QgsExpressionNode | None[source]¶
- Return type:
QgsExpressionNode|None