Class: QgsScopedExpressionFunction¶
- class qgis.core.QgsScopedExpressionFunction¶
Bases:
QgsExpressionFunction
Expression function for use within a
QgsExpressionContextScope
. This differs from a standardQgsExpression
.Function in that it requires an implementedclone()
method.New in version 2.12.
QgsScopedExpressionFunction(fnname: str, params: int, group: str, helpText: str = ‘’, usesGeometry: bool = False, referencedColumns: Iterable[str] = set(), lazyEval: bool = False, handlesNull: bool = False, isContextual: bool = True) Create a new QgsScopedExpressionFunction
New in version 2.12.
QgsScopedExpressionFunction(fnname: str, params: Iterable[QgsExpressionFunction.Parameter], group: str, helpText: str = ‘’, usesGeometry: bool = False, referencedColumns: Iterable[str] = set(), lazyEval: bool = False, handlesNull: bool = False, isContextual: bool = True) Create a new
QgsScopedExpressionFunction
using named parameters.New in version 3.0.
QgsScopedExpressionFunction(
QgsScopedExpressionFunction
)Methods
This will return
True
if all the params for the provided functionnode
are static within the constraints imposed by thecontext
within the givenparent
.Returns a clone of the function.
- param values:
- param node:
- param node:
- param node:
- allParamsStatic(node: QgsExpressionNodeFunction, parent: QgsExpression, context: QgsExpressionContext) bool ¶
This will return
True
if all the params for the provided functionnode
are static within the constraints imposed by thecontext
within the givenparent
.This can be used as callback for custom implementations of subclasses. It is the default for implementation for StaticFunction.isStatic.
New in version 3.0.
- clone(self) QgsScopedExpressionFunction ¶
Returns a clone of the function.
- Return type:
- func(self, values: Iterable[Any], context: QgsExpressionContext, parent: QgsExpression, node: QgsExpressionNodeFunction) Any ¶
- Parameters:
values (Iterable[Any]) –
context (QgsExpressionContext) –
parent (QgsExpression) –
node (QgsExpressionNodeFunction) –
- Return type:
Any
- isStatic(self, node: QgsExpressionNodeFunction, parent: QgsExpression, context: QgsExpressionContext) bool ¶
- Parameters:
node (QgsExpressionNodeFunction) –
parent (QgsExpression) –
context (QgsExpressionContext) –
- Return type:
bool
- referencedColumns(self, node: QgsExpressionNodeFunction) Set[str] ¶
- Parameters:
node (QgsExpressionNodeFunction) –
- Return type:
Set[str]
- usesGeometry(self, node: QgsExpressionNodeFunction) bool ¶
- Parameters:
node (QgsExpressionNodeFunction) –
- Return type:
bool