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.  | 
|
- 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
conditionsand an optionalelseExpexpression.- Parameters:
 conditions (Optional[Iterable[QgsExpressionNodeCondition.WhenThen]])
elseExp (Optional[QgsExpressionNode] = None)
- __init__(a0: QgsExpressionNodeCondition)
 - Parameters:
 
- class WhenThen[source]¶
 Bases:
objectRepresents 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.
- evalNode(self, parent: QgsExpression | None, context: QgsExpressionContext | None) Any[source]¶
 - Parameters:
 parent (Optional[QgsExpression])
context (Optional[QgsExpressionContext])
- Return type:
 Any
- prepareNode(self, parent: QgsExpression | None, context: QgsExpressionContext | None) bool[source]¶
 - Parameters:
 parent (Optional[QgsExpression])
context (Optional[QgsExpressionContext])
- Return type:
 bool