QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
QgsProcessingParameterType Class Referenceabstract

Makes metadata of processing parameters available. More...

#include <qgsprocessingparametertype.h>

Inheritance diagram for QgsProcessingParameterType:
Inheritance graph
[legend]

Public Types

enum  ParameterFlag { ExposeToModeler = 1 }
 Each parameter type can offer a number of additional flags to finetune its behavior and capabilities. More...
 

Public Member Functions

virtual ~QgsProcessingParameterType ()=default
 Destructor.
 
virtual QStringList acceptedPythonTypes () const
 Returns a list of the Python data types accepted as values for the parameter.
 
virtual QStringList acceptedStringValues () const
 Returns a descriptive list of the possible string values acceptable for the parameter.
 
virtual QString className () const
 Returns the corresponding class name for the parameter type.
 
virtual QgsProcessingParameterDefinitioncreate (const QString &name) const =0
 Creates a new parameter of this type.
 
virtual QString description () const =0
 A human readable and translatable description for this parameter type.
 
virtual ParameterFlags flags () const
 Determines if this parameter is available in the modeler.
 
virtual QString id () const =0
 A static id for this type which will be used for storing this parameter type.
 
virtual QVariantMap metadata () const
 Metadata for this parameter type.
 
virtual QString name () const =0
 A human readable and translatable short name for this parameter type.
 
virtual QString pythonImportString () const
 Returns a valid Python import string for importing the corresponding parameter type, e.g.
 

Detailed Description

Makes metadata of processing parameters available.

Since
QGIS 3.2

Definition at line 33 of file qgsprocessingparametertype.h.

Member Enumeration Documentation

◆ ParameterFlag

Each parameter type can offer a number of additional flags to finetune its behavior and capabilities.

Enumerator
ExposeToModeler 

Is this parameter available in the modeler. Is set to on by default.

Definition at line 41 of file qgsprocessingparametertype.h.

Constructor & Destructor Documentation

◆ ~QgsProcessingParameterType()

virtual QgsProcessingParameterType::~QgsProcessingParameterType ( )
virtualdefault

Destructor.

Member Function Documentation

◆ acceptedPythonTypes()

QStringList QgsProcessingParameterType::acceptedPythonTypes ( ) const
virtual

Returns a list of the Python data types accepted as values for the parameter.

E.g. "str", "QgsVectorLayer", "QgsMapLayer", etc.

These values should should match the Python types exactly (e.g. "str" not "string", "bool" not "boolean"). Extra explanatory help can be used (which must be translated), eg "str: as comma delimited list of numbers".

See also
acceptedStringValues()

Definition at line 30 of file qgsprocessingparametertype.cpp.

◆ acceptedStringValues()

QStringList QgsProcessingParameterType::acceptedStringValues ( ) const
virtual

Returns a descriptive list of the possible string values acceptable for the parameter.

E.g. for a QgsProcessingParameterVectorLayer this may include "Path to a vector layer", for QgsProcessingParameterBoolean "1 for true, 0 for false" etc.

Extra explanatory help can be used (which must be translated), eg "a comma delimited list of numbers".

See also
acceptedPythonTypes()
Since
QGIS 3.8

Definition at line 35 of file qgsprocessingparametertype.cpp.

◆ className()

virtual QString QgsProcessingParameterType::className ( ) const
inlinevirtual

Returns the corresponding class name for the parameter type.

See also
pythonImportString()
Since
QGIS 3.6

Definition at line 90 of file qgsprocessingparametertype.h.

◆ create()

virtual QgsProcessingParameterDefinition * QgsProcessingParameterType::create ( const QString &  name) const
pure virtual

Creates a new parameter of this type.

◆ description()

virtual QString QgsProcessingParameterType::description ( ) const
pure virtual

A human readable and translatable description for this parameter type.

This can be a longer description suitable for tooltips and other elements that give the user context for a given parameter.

◆ flags()

QgsProcessingParameterType::ParameterFlags QgsProcessingParameterType::flags ( ) const
virtual

Determines if this parameter is available in the modeler.

The default implementation returns true.

Definition at line 20 of file qgsprocessingparametertype.cpp.

◆ id()

virtual QString QgsProcessingParameterType::id ( ) const
pure virtual

A static id for this type which will be used for storing this parameter type.

◆ metadata()

QVariantMap QgsProcessingParameterType::metadata ( ) const
virtual

Metadata for this parameter type.

Can be used for example to define custom widgets. The default implementation returns an empty map.

Definition at line 25 of file qgsprocessingparametertype.cpp.

◆ name()

virtual QString QgsProcessingParameterType::name ( ) const
pure virtual

A human readable and translatable short name for this parameter type.

This will be used in comboboxes and list widgets.

◆ pythonImportString()

virtual QString QgsProcessingParameterType::pythonImportString ( ) const
inlinevirtual

Returns a valid Python import string for importing the corresponding parameter type, e.g.

"from qgis.core import QgsProcessingParameterBoolean".

See also
className()
Since
QGIS 3.6

Definition at line 80 of file qgsprocessingparametertype.h.


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