Class: QgsExpressionNodeCondition¶
An expression node for CASE WHEN clauses.
Class Hierarchy¶
Base classes¶
Abstract base class for all nodes that can appear in an expression. |
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] | None, elseExp: QgsExpressionNode | None = None)
Create a new node with the given list of
conditions
and an optionalelseExp
expression.- Parameters:
conditions (Optional[Iterable[QgsExpressionNodeCondition.WhenThen]])
elseExp (Optional[QgsExpressionNode] = None)
- class WhenThen[source]¶
Bases:
object
Represents a “WHEN… THEN…” portation of a CASE WHEN clause in an expression.
QgsExpressionNodeCondition.WhenThen(whenExp: Optional[QgsExpressionNode], thenExp: Optional[QgsExpressionNode]) A combination of when and then. Simple as that.
- thenExp(self) QgsExpressionNode | None [source]¶
The expression node that makes the THEN result part of the condition.
- Return type:
Optional[QgsExpressionNode]
- 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:
Optional[QgsExpressionNode]
- Returns:
The expression node that makes the WHEN part of the condition check.
- 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:
Optional[QgsExpressionNode]
- Returns:
The ELSE expression used for the condition.
- virtual evalNode(self, parent: QgsExpression | None, context: QgsExpressionContext | None) Any [source]¶
- Parameters:
parent (Optional[QgsExpression])
context (Optional[QgsExpressionContext])
- Return type:
Any
- virtual prepareNode(self, parent: QgsExpression | None, context: QgsExpressionContext | None) bool [source]¶
- Parameters:
parent (Optional[QgsExpression])
context (Optional[QgsExpressionContext])
- Return type:
bool