Class: QgsExpressionNodeUnaryOperator

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

Note

This is an abstract class, with methods which must be implemented by a subclass.

The following methods must be implemented: QgsExpressionNode.needsGeometry()

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:
class UnaryOperator

Bases: int

virtual 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]

virtual 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