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¶
Base classes¶
Abstract base class for all nodes that can appear in an expression. |
Methods
Returns the unary operator. |
|
Returns the node the operator will operate upon. |
|
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.
Attributes
- 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 withop
.- Parameters:
operand (Optional[QgsExpressionNode])
- class UnaryOperator¶
Bases:
int
- virtual evalNode(self, parent: QgsExpression | None, context: QgsExpressionContext | None) Any [source]¶
- Parameters:
parent (Optional[QgsExpression])
context (Optional[QgsExpressionContext])
- Return type:
Any
- op(self) QgsExpressionNodeUnaryOperator.UnaryOperator [source]¶
Returns the unary operator.
- Return type:
- 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:
parent (Optional[QgsExpression])
context (Optional[QgsExpressionContext])
- 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¶