Class: QgsProcessingParameterField¶
A vector layer or feature source field parameter for processing algorithms.
Class Hierarchy¶
Base classes¶
Base class for the definition of processing parameters. |
Enums
alias of |
Methods
Returns whether multiple field selections are permitted. |
|
Returns the acceptable data type for the field. |
|
Returns whether a parameter which allows multiple selections (see |
|
Returns the name of the parent layer parameter, or an empty string if this is not set. |
|
Sets whether multiple field selections are permitted. |
|
Sets the acceptable data type for the field. |
|
Sets whether a parameter which allows multiple selections (see |
|
Sets the name of the parent layer parameter. |
Static Methods
Creates a new parameter using the definition from a script code. |
|
Returns the type name for the parameter class. |
- class qgis.core.QgsProcessingParameterField[source]¶
Bases:
QgsProcessingParameterDefinition
- __init__(name: str | None, description: str | None = '', defaultValue: Any = None, parentLayerParameterName: str | None = '', type: Qgis.ProcessingFieldParameterDataType = Qgis.ProcessingFieldParameterDataType.Any, allowMultiple: bool = False, optional: bool = False, defaultToAllFields: bool = False)
Constructor for QgsProcessingParameterField.
- Parameters:
name (Optional[str])
description (Optional[str] = '')
defaultValue (Any = None)
parentLayerParameterName (Optional[str] = '')
type (Qgis.ProcessingFieldParameterDataType = Qgis.ProcessingFieldParameterDataType.Any)
allowMultiple (bool = False)
optional (bool = False)
defaultToAllFields (bool = False)
- __init__(a0: QgsProcessingParameterField)
- Parameters:
- DataType¶
alias of
ProcessingFieldParameterDataType
- allowMultiple(self) bool [source]¶
Returns whether multiple field selections are permitted.
See also
- Return type:
bool
- dataType(self) Qgis.ProcessingFieldParameterDataType [source]¶
Returns the acceptable data type for the field.
See also
- Return type:
- defaultToAllFields(self) bool [source]¶
Returns whether a parameter which allows multiple selections (see
allowMultiple()
) should automatically select all fields as the default value.If
True
, this will override any existingdefaultValue()
set on the parameter.See also
Added in version 3.12.
- Return type:
bool
- static fromScriptCode(name: str | None, description: str | None, isOptional: bool, definition: str | None) QgsProcessingParameterField | None [source]¶
Creates a new parameter using the definition from a script code.
- Parameters:
name (Optional[str])
description (Optional[str])
isOptional (bool)
definition (Optional[str])
- Return type:
Optional[QgsProcessingParameterField]
- parentLayerParameterName(self) str [source]¶
Returns the name of the parent layer parameter, or an empty string if this is not set.
See also
- Return type:
str
- setAllowMultiple(self, allowMultiple: bool)[source]¶
Sets whether multiple field selections are permitted.
See also
- Parameters:
allowMultiple (bool)
- setDataType(self, type: Qgis.ProcessingFieldParameterDataType)[source]¶
Sets the acceptable data
type
for the field.See also
- Parameters:
- setDefaultToAllFields(self, enabled: bool)[source]¶
Sets whether a parameter which allows multiple selections (see
allowMultiple()
) should automatically select all fields as the default value.If
True
, this will override any existingdefaultValue()
set on the parameter.See also
Added in version 3.12.
- Parameters:
enabled (bool)