Class: QgsProcessingParameterType

class qgis.core.QgsProcessingParameterType

Bases: sip.wrapper

Makes metadata of processing parameters available.

New in version 3.2:

Methods

acceptedPythonTypes

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

acceptedStringValues

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

className

Returns the corresponding class name for the parameter type.

create

Creates a new parameter of this type.

description

A human readable and translatable description for this parameter type.

flags

Determines if this parameter is available in the modeler.

id

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

metadata

Metadata for this parameter type.

name

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

pythonImportString

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

Attributes

ExposeToModeler

ExposeToModeler = 1
class ParameterFlag

Bases: int

class ParameterFlags
class ParameterFlags(Union[QgsProcessingParameterType.ParameterFlags, QgsProcessingParameterType.ParameterFlag])
class ParameterFlags(QgsProcessingParameterType.ParameterFlags)

Bases: sip.wrapper

acceptedPythonTypes(self) List[str]

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”.

Return type:

List[str]

acceptedStringValues(self) List[str]

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”.

New in version 3.8.

Return type:

List[str]

className(self) str

Returns the corresponding class name for the parameter type.

New in version 3.6.

Return type:

str

create(self, name: str) QgsProcessingParameterDefinition

Creates a new parameter of this type.

Parameters:

name (str) –

Return type:

QgsProcessingParameterDefinition

description(self) str

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.

Return type:

str

flags(self) QgsProcessingParameterType.ParameterFlags

Determines if this parameter is available in the modeler. The default implementation returns True.

Return type:

QgsProcessingParameterType.ParameterFlags

id(self) str

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

Return type:

str

metadata(self) Dict[str, Any]

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

Return type:

Dict[str, Any]

name(self) str

A human readable and translatable short name for this parameter type. This will be used in comboboxes and list widgets.

Return type:

str

pythonImportString(self) str

Returns a valid Python import string for importing the corresponding parameter type, e.g. “from qgis.core import QgsProcessingParameterBoolean”.

See also

className()

New in version 3.6.

Return type:

str