Subgroup: Processing

Class: QgsProcessingParameterField

class qgis.core.QgsProcessingParameterField

Bases: qgis._core.QgsProcessingParameterDefinition

A vector layer or feature source field parameter for processing algorithms.

New in version 3.0: Methods

algorithm Returns a pointer to the algorithm which owns this parameter.
allowMultiple Returns whether multiple field selections are permitted.
asScriptCode
checkValueIsAcceptable
clone
dataType Returns the acceptable data type for the field.
defaultValue Returns the default value for the parameter.
dependsOnOtherParameters
description Returns the description for the parameter.
dynamicLayerParameterName Returns the name of the parameter for a layer linked to a dynamic parameter, or an empty string if this is not set.
dynamicPropertyDefinition Returns the property definition for dynamic properties.
flags Returns any flags associated with the parameter.
fromScriptCode Creates a new parameter using the definition from a script code.
fromVariantMap
isDestination Returns true if this parameter represents a file or layer destination, e.g.
isDynamic Returns true if the parameter supports is dynamic, and can support data-defined values (i.e.
metadata Returns the parameter’s freeform metadata.
name Returns the name of the parameter.
parentLayerParameterName Returns the name of the parent layer parameter, or an empty string if this is not set.
provider Returns a pointer to the provider for the algorithm which owns this parameter.
setAllowMultiple Sets whether multiple field selections are permitted.
setDataType Sets the acceptable data type for the field.
setDefaultValue Sets the default value for the parameter.
setDescription Sets the description for the parameter.
setDynamicLayerParameterName Sets the name for the parameter for a layer linked to a dynamic parameter, or an empty string if this is not set.
setDynamicPropertyDefinition Sets the property definition for dynamic properties.
setFlags Sets the flags associated with the parameter.
setIsDynamic Sets whether the parameter is dynamic, and can support data-defined values (i.e.
setMetadata Sets the parameter’s freeform metadata.
setName Sets the name of the parameter.
setParentLayerParameterName Sets the name of the parent layer parameter.
toVariantMap
toolTip Returns a formatted tooltip for use with the parameter, which gives helpful information like parameter description, ID, and extra content like default values (depending on parameter type).
type
typeName Returns the type name for the parameter class.
valueAsPythonString

Attributes

Any
DateTime
FlagAdvanced
FlagHidden
FlagOptional
Numeric
String
Any = -1
class DataType

Bases: int

DateTime = 2
Numeric = 0
String = 1
allowMultiple(self) → bool

Returns whether multiple field selections are permitted.

asScriptCode(self) → str
checkValueIsAcceptable(self, input: Any, context: QgsProcessingContext = None) → bool
clone(self) → QgsProcessingParameterDefinition
dataType(self) → QgsProcessingParameterField.DataType

Returns the acceptable data type for the field.

See also

setDataType()

dependsOnOtherParameters(self) → List[str]
fromScriptCode(name: str, description: str, isOptional: bool, definition: str) → QgsProcessingParameterField

Creates a new parameter using the definition from a script code.

fromVariantMap(self, map: Dict[str, Any]) → bool
parentLayerParameterName(self) → str

Returns the name of the parent layer parameter, or an empty string if this is not set.

setAllowMultiple(self, allowMultiple: bool)

Sets whether multiple field selections are permitted.

See also

allowMultiple()

setDataType(self, type: QgsProcessingParameterField.DataType)

Sets the acceptable data type for the field.

See also

dataType()

setParentLayerParameterName(self, parentLayerParameterName: str)

Sets the name of the parent layer parameter. Use an empty string if this is not required.

toVariantMap(self) → Dict[str, Any]
type(self) → str
typeName() → str

Returns the type name for the parameter class.

valueAsPythonString(self, value: Any, context: QgsProcessingContext) → str