QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Public Member Functions | List of all members
QgsExpression::StaticFunction Class Reference

c++ helper class for defining QgsExpression functions. More...

#include <qgsexpression.h>

Inheritance diagram for QgsExpression::StaticFunction:
Inheritance graph
[legend]

Public Member Functions

Q_DECL_DEPRECATED StaticFunction (const QString &fnname, int params, FcnEval fcn, const QString &group, const QString &helpText=QString(), bool usesGeometry=false, const QStringList &referencedColumns=QStringList(), bool lazyEval=false, const QStringList &aliases=QStringList(), bool handlesNull=false)
 
 StaticFunction (const QString &fnname, int params, FcnEvalContext fcn, const QString &group, const QString &helpText=QString(), bool usesGeometry=false, const QStringList &referencedColumns=QStringList(), bool lazyEval=false, const QStringList &aliases=QStringList(), bool handlesNull=false)
 Static function for evaluation against a QgsExpressionContext, using an unnamed list of parameter values. More...
 
 StaticFunction (const QString &fnname, const ParameterList &params, FcnEvalContext fcn, const QString &group, const QString &helpText=QString(), bool usesGeometry=false, const QStringList &referencedColumns=QStringList(), bool lazyEval=false, const QStringList &aliases=QStringList(), bool handlesNull=false)
 Static function for evaluation against a QgsExpressionContext, using a named list of parameter values. More...
 
 StaticFunction (const QString &fnname, const ParameterList &params, FcnEvalContext fcn, const QStringList &groups, const QString &helpText=QString(), bool usesGeometry=false, const QStringList &referencedColumns=QStringList(), bool lazyEval=false, const QStringList &aliases=QStringList(), bool handlesNull=false)
 Static function for evaluation against a QgsExpressionContext, using a named list of parameter values and list of groups. More...
 
virtual ~StaticFunction ()
 
virtual QStringList aliases () const override
 Returns a list of possible aliases for the function. More...
 
virtual Q_DECL_DEPRECATED QVariant func (const QVariantList &values, const QgsFeature *f, QgsExpression *parent) override
 
virtual QVariant func (const QVariantList &values, const QgsExpressionContext *context, QgsExpression *parent) override
 Returns result of evaluating the function. More...
 
- Public Member Functions inherited from QgsExpression::Function
 Function (const QString &fnname, int params, const QString &group, const QString &helpText=QString(), bool usesGeometry=false, const QStringList &referencedColumns=QStringList(), bool lazyEval=false, bool handlesNull=false, bool isContextual=false)
 Constructor for function which uses unnamed parameters. More...
 
 Function (const QString &fnname, int params, const QStringList &groups, const QString &helpText=QString(), bool usesGeometry=false, const QStringList &referencedColumns=QStringList(), bool lazyEval=false, bool handlesNull=false, bool isContextual=false)
 Constructor for function which uses unnamed parameters and group list. More...
 
 Function (const QString &fnname, const ParameterList &params, const QString &group, const QString &helpText=QString(), bool usesGeometry=false, const QStringList &referencedColumns=QStringList(), bool lazyEval=false, bool handlesNull=false, bool isContextual=false)
 Constructor for function which uses named parameter list. More...
 
 Function (const QString &fnname, const ParameterList &params, const QStringList &groups, const QString &helpText=QString(), bool usesGeometry=false, const QStringList &referencedColumns=QStringList(), bool lazyEval=false, bool handlesNull=false, bool isContextual=false)
 Constructor for function which uses named parameter list and group list. More...
 
virtual ~Function ()
 
QString group () const
 Returns the first group which the function belongs to. More...
 
QStringList groups () const
 Returns a list of the groups the function belongs to. More...
 
virtual bool handlesNull () const
 
const QString helptext () const
 The help text for the function. More...
 
bool isContextual () const
 Returns whether the function is only available if provided by a QgsExpressionContext object. More...
 
virtual bool isDeprecated () const
 Returns true if the function is deprecated and should not be presented as a valid option to users in expression builders. More...
 
bool lazyEval () const
 True if this function should use lazy evaluation. More...
 
int minParams () const
 The mininum number of parameters this function takes. More...
 
QString name () const
 The name of the function. More...
 
bool operator== (const Function &other) const
 
const ParameterListparameters () const
 Returns the list of named parameters for the function, if set. More...
 
int params () const
 The number of parameters this function takes. More...
 
virtual QStringList referencedColumns () const
 
bool usesgeometry () const
 Does this function use a geometry object. More...
 

Detailed Description

c++ helper class for defining QgsExpression functions.

Note
not available in Python bindings

Definition at line 728 of file qgsexpression.h.

Constructor & Destructor Documentation

◆ StaticFunction() [1/4]

Q_DECL_DEPRECATED QgsExpression::StaticFunction::StaticFunction ( const QString fnname,
int  params,
FcnEval  fcn,
const QString group,
const QString helpText = QString(),
bool  usesGeometry = false,
const QStringList referencedColumns = QStringList(),
bool  lazyEval = false,
const QStringList aliases = QStringList(),
bool  handlesNull = false 
)
inline
Deprecated:
use QgsExpressionContext variant instead

Definition at line 732 of file qgsexpression.h.

◆ ~StaticFunction()

virtual QgsExpression::StaticFunction::~StaticFunction ( )
inlinevirtual

Definition at line 748 of file qgsexpression.h.

◆ StaticFunction() [2/4]

QgsExpression::StaticFunction::StaticFunction ( const QString fnname,
int  params,
FcnEvalContext  fcn,
const QString group,
const QString helpText = QString(),
bool  usesGeometry = false,
const QStringList referencedColumns = QStringList(),
bool  lazyEval = false,
const QStringList aliases = QStringList(),
bool  handlesNull = false 
)
inline

Static function for evaluation against a QgsExpressionContext, using an unnamed list of parameter values.

Definition at line 752 of file qgsexpression.h.

◆ StaticFunction() [3/4]

QgsExpression::StaticFunction::StaticFunction ( const QString fnname,
const ParameterList params,
FcnEvalContext  fcn,
const QString group,
const QString helpText = QString(),
bool  usesGeometry = false,
const QStringList referencedColumns = QStringList(),
bool  lazyEval = false,
const QStringList aliases = QStringList(),
bool  handlesNull = false 
)
inline

Static function for evaluation against a QgsExpressionContext, using a named list of parameter values.

Definition at line 770 of file qgsexpression.h.

◆ StaticFunction() [4/4]

QgsExpression::StaticFunction::StaticFunction ( const QString fnname,
const ParameterList params,
FcnEvalContext  fcn,
const QStringList groups,
const QString helpText = QString(),
bool  usesGeometry = false,
const QStringList referencedColumns = QStringList(),
bool  lazyEval = false,
const QStringList aliases = QStringList(),
bool  handlesNull = false 
)
inline

Static function for evaluation against a QgsExpressionContext, using a named list of parameter values and list of groups.

Definition at line 789 of file qgsexpression.h.

Member Function Documentation

◆ aliases()

virtual QStringList QgsExpression::StaticFunction::aliases ( ) const
inlineoverridevirtual

Returns a list of possible aliases for the function.

These include other permissible names for the function, eg deprecated names.

Returns
list of known aliases
Note
added in QGIS 2.9

Reimplemented from QgsExpression::Function.

Definition at line 819 of file qgsexpression.h.

◆ func() [1/2]

QVariant QgsExpression::StaticFunction::func ( const QVariantList &  values,
const QgsFeature f,
QgsExpression parent 
)
overridevirtual
Deprecated:
use QgsExpressionContext variant instead

Reimplemented from QgsExpression::Function.

Definition at line 5320 of file qgsexpression.cpp.

◆ func() [2/2]

virtual QVariant QgsExpression::StaticFunction::func ( const QVariantList &  values,
const QgsExpressionContext context,
QgsExpression parent 
)
inlineoverridevirtual

Returns result of evaluating the function.

Parameters
valueslist of values passed to the function
contextcontext expression is being evaluated against
parentparent expression
Returns
result of function

Reimplemented from QgsExpression::Function.

Definition at line 814 of file qgsexpression.h.


The documentation for this class was generated from the following files: