Class: QgsExpressionNodeCondition¶
- class qgis.core.QgsExpressionNodeCondition(conditions: Iterable[QgsExpressionNodeCondition.WhenThen], elseExp: QgsExpressionNode = None)¶
Bases:
QgsExpressionNode
Create a new node with the given list of
conditions
and an optionalelseExp
expression.QgsExpressionNodeCondition(
QgsExpressionNodeCondition
)An expression node for CASE WHEN clauses.
Methods
- rtype
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(whenExp: QgsExpressionNode, thenExp: QgsExpressionNode)¶
Bases:
sip.wrapper
A combination of when and then. Simple as that.
Represents a “WHEN… THEN…” portation of a CASE WHEN clause in an expression.
- clone(self) → QgsExpressionNodeCondition.WhenThen¶
Gets a deep copy of this WhenThen combination.
- Return type
- thenExp(self) → QgsExpressionNode¶
The expression node that makes the THEN result part of the condition.
- Return type
- Returns
The expression node that makes the THEN result part of the condition.
- whenExp(self) → QgsExpressionNode¶
The expression that makes the WHEN part of the condition.
- Return type
- Returns
The expression node that makes the WHEN part of the condition check.
- clone(self) → QgsExpressionNode¶
- Return type
- 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¶
The ELSE expression used for the condition.
- Return type
- Returns
The ELSE expression used for the condition.
- evalNode(self, parent: QgsExpression, context: QgsExpressionContext) → Any¶
- Parameters
parent (QgsExpression) –
context (QgsExpressionContext) –
- Return type
Any
- isStatic(self, parent: QgsExpression, context: QgsExpressionContext) → bool¶
- Parameters
parent (QgsExpression) –
context (QgsExpressionContext) –
- Return type
bool
- needsGeometry(self) → bool¶
- Return type
bool
- nodeType(self) → QgsExpressionNode.NodeType¶
- Return type
- prepareNode(self, parent: QgsExpression, context: QgsExpressionContext) → bool¶
- Parameters
parent (QgsExpression) –
context (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]