mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Add documentation for @qgsfunction
This commit is contained in:
parent
4d5eb49f1c
commit
45fdd0fb31
@ -50,8 +50,8 @@ def register_function(function, arg_count, group, usesgeometry=False,
|
||||
:param function:
|
||||
:param arg_count:
|
||||
:param group:
|
||||
:param usesgeometry:
|
||||
:param handlesnull:
|
||||
:param usesgeometry:
|
||||
:param handlesnull: Needs to be set to True if this function has does not always return NULL if any parameter is NULL. Default False.
|
||||
:return:
|
||||
"""
|
||||
|
||||
@ -137,6 +137,19 @@ def qgsfunction(args='auto', group='custom', **kwargs):
|
||||
"""
|
||||
Decorator function used to define a user expression function.
|
||||
|
||||
:param args: Number of parameters, set to 'auto' to accept a variable length of parameters.
|
||||
:param group: The expression group to which this expression should be added.
|
||||
:param \**kwargs:
|
||||
See below
|
||||
|
||||
:Keyword Arguments:
|
||||
* *referenced_columns* (``list``) --
|
||||
An array of field names on which this expression works. Can be set to ``[QgsFeatureRequest.ALL_ATTRIBUTES]``. By default empty.
|
||||
* *usesgeometry* (``bool``) --
|
||||
Defines if this expression requires the geometry. By default False.
|
||||
* *handlesnull* (``bool``) --
|
||||
Defines if this expression has custom handling for NULL values. If False, the result will always be NULL as soon as any parameter is NULL. False by default.
|
||||
|
||||
Example:
|
||||
@qgsfunction(2, 'test'):
|
||||
def add(values, feature, parent):
|
||||
|
Loading…
x
Reference in New Issue
Block a user