Class: QgsExpressionNodeUnaryOperator

A unary node is either negative as in boolean (not) or as in numbers (minus).

Class Hierarchy

Inheritance diagram of qgis.core.QgsExpressionNodeUnaryOperator

Base classes

QgsExpressionNode

Abstract base class for all nodes that can appear in an expression.

class qgis.core.QgsExpressionNodeUnaryOperator[source]

Bases: QgsExpressionNode

__init__(op: QgsExpressionNodeUnaryOperator.UnaryOperator, operand: QgsExpressionNode | None)

A node unary operator is modifying the value of operand by negating it with op.

Parameters:
__init__(a0: QgsExpressionNodeUnaryOperator)
Parameters:

a0 (QgsExpressionNodeUnaryOperator)

class UnaryOperator

Bases: int

evalNode(self, parent: QgsExpression | None, context: QgsExpressionContext | None) Any[source]
Parameters:
Return type:

Any

op(self) QgsExpressionNodeUnaryOperator.UnaryOperator[source]

Returns the unary operator.

Return type:

QgsExpressionNodeUnaryOperator.UnaryOperator

operand(self) QgsExpressionNode | None[source]

Returns the node the operator will operate upon.

Return type:

Optional[QgsExpressionNode]

prepareNode(self, parent: QgsExpression | None, context: QgsExpressionContext | None) bool[source]
Parameters:
Return type:

bool

text(self) str[source]

Returns a the name of this operator without the operands. I.e. “NOT” or “-”

Return type:

str

uoMinus = 1
uoNot = 0