Class: QgsProcessingParameterType¶
- class qgis.core.QgsProcessingParameterType¶
Bases:
sip.wrapper
Makes metadata of processing parameters available.
New in version 3.2:
Methods
Returns a list of the Python data types accepted as values for the parameter.
Returns a descriptive list of the possible string values acceptable for the parameter.
Returns the corresponding class name for the parameter type.
Creates a new parameter of this type.
A human readable and translatable description for this parameter type.
Determines if this parameter is available in the modeler.
A static id for this type which will be used for storing this parameter type.
Metadata for this parameter type.
A human readable and translatable short name for this parameter type.
Returns a valid Python import string for importing the corresponding parameter type, e.g. "from qgis.core import
QgsProcessingParameterBoolean
".Attributes
- 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”.
See also
- 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”, forQgsProcessingParameterBoolean
“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
New in version 3.8.
- Return type:
List[str]
- className(self) str ¶
Returns the corresponding class name for the parameter type.
See also
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:
- 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:
- 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
New in version 3.6.
- Return type:
str