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 optional elseExp expression.

QgsExpressionNodeCondition(QgsExpressionNodeCondition)

An expression node for CASE WHEN clauses.

Parameters
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.

Parameters
clone(self)QgsExpressionNodeCondition.WhenThen

Gets a deep copy of this WhenThen combination.

Return type

QgsExpressionNodeCondition.WhenThen

thenExp(self)QgsExpressionNode

The expression node that makes the THEN result part of the condition.

Return type

QgsExpressionNode

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

QgsExpressionNode

Returns

The expression node that makes the WHEN part of the condition check.

clone(self)QgsExpressionNode
Return type

QgsExpressionNode

conditions(self) → List[QgsExpressionNodeCondition.WhenThen]

The list of WHEN THEN expression parts of the expression.

Return type

List[QgsExpressionNodeCondition.WhenThen]

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

QgsExpressionNode

Returns

The ELSE expression used for the condition.

evalNode(self, parent: QgsExpression, context: QgsExpressionContext) → Any
Parameters
Return type

Any

isStatic(self, parent: QgsExpression, context: QgsExpressionContext) → bool
Parameters
Return type

bool

needsGeometry(self) → bool
Return type

bool

nodeType(self)QgsExpressionNode.NodeType
Return type

QgsExpressionNode.NodeType

prepareNode(self, parent: QgsExpression, context: QgsExpressionContext) → bool
Parameters
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]