Skip to content
Permalink
Browse files

Add documentation for @qgsfunction

  • Loading branch information
m-kuhn committed Jul 1, 2018
1 parent 4d5eb49 commit 45fdd0fb31f65dd292db748d81e4da4c3dd3b371
Showing with 15 additions and 2 deletions.
  1. +15 −2 python/core/additions/qgsfunction.py
@@ -50,8 +50,8 @@ def myfunc(values, *args):
: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):

0 comments on commit 45fdd0f

Please sign in to comment.
You can’t perform that action at this time.