Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add documentation for @qgsfunction
  • Loading branch information
m-kuhn committed Jul 1, 2018
1 parent 4d5eb49 commit 45fdd0f
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions python/core/additions/qgsfunction.py
Expand Up @@ -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:
"""

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 45fdd0f

Please sign in to comment.