Class: QgsExpressionNodeUnaryOperator

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

List of all members, including inherited members

Class Hierarchy

Inheritance diagram of qgis.core.QgsExpressionNodeUnaryOperator

Base classes

QgsExpressionNode

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

Enums

UnaryOperator

Methods

op

Returns the unary operator.

operand

Returns the node the operator will operate upon.

text

Returns a the name of this operator without the operands.

Virtual Methods

In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsExpressionNodeUnaryOperator. See the FAQ for more details.

evalNode

prepareNode

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(*values)

Bases: IntEnum

uoMinus = 1
uoNot = 0
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