Class: QgsExpressionNodeCondition¶
- class qgis.core.QgsExpressionNodeCondition¶
Bases:
QgsExpressionNode
An expression node for CASE WHEN clauses.
QgsExpressionNodeCondition(conditions: Optional[Iterable[QgsExpressionNodeCondition.WhenThen]], elseExp: Optional[QgsExpressionNode] = None) Create a new node with the given list of
conditions
and an optionalelseExp
expression.QgsExpressionNodeCondition(a0:
QgsExpressionNodeCondition
)Methods
- rtype:
Optional[QgsExpressionNode]
The list of WHEN THEN expression parts of the expression.
- rtype:
str
The ELSE expression used for the condition.
- param parent:
- param parent:
- rtype:
bool
- rtype:
QgsExpressionNode.NodeType
- param parent:
- rtype:
Set[str]
- rtype:
Set[str]
- rtype:
Set[str]
- class WhenThen¶
Bases:
sip.wrapper
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.
- clone(self) QgsExpressionNodeCondition.WhenThen | None ¶
Gets a deep copy of this WhenThen combination.
- Return type:
Optional[QgsExpressionNodeCondition.WhenThen]
- thenExp(self) QgsExpressionNode | None ¶
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 ¶
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.
- clone(self) QgsExpressionNode | None ¶
- Return type:
Optional[QgsExpressionNode]
- conditions(self) List[QgsExpressionNodeCondition.WhenThen] ¶
The list of WHEN THEN expression parts of the expression.
- Return type:
- Returns:
The list of WHEN THEN expression parts of the expression.
- dump(self) str ¶
- Return type:
str
- elseExp(self) QgsExpressionNode | None ¶
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 ¶
- Parameters:
parent (Optional[QgsExpression])
context (Optional[QgsExpressionContext])
- Return type:
Any
- isStatic(self, parent: QgsExpression | None, context: QgsExpressionContext | None) bool ¶
- Parameters:
parent (Optional[QgsExpression])
context (Optional[QgsExpressionContext])
- Return type:
bool
- needsGeometry(self) bool ¶
- Return type:
bool
- nodeType(self) QgsExpressionNode.NodeType ¶
- Return type:
- prepareNode(self, parent: QgsExpression | None, context: QgsExpressionContext | None) bool ¶
- Parameters:
parent (Optional[QgsExpression])
context (Optional[QgsExpressionContext])
- Return type:
bool
- referencedColumns(self) Set[str] ¶
- Return type:
Set[str]
- referencedFunctions(self) Set[str] ¶
- Return type:
Set[str]
- referencedVariables(self) Set[str] ¶
- Return type:
Set[str]