Subgroup: Processing

Class: QgsProcessingParameterNumber

class qgis.core.QgsProcessingParameterNumber

Bases: qgis._core.QgsProcessingParameterDefinition

A numeric parameter for processing algorithms.

New in version 3.0: Methods

algorithm Returns a pointer to the algorithm which owns this parameter.
asScriptCode Returns the parameter definition encoded in a string which can be used within a Python processing script.
checkValueIsAcceptable
clone
dataType Returns the acceptable data type for the parameter.
defaultValue Returns the default value for the parameter.
dependsOnOtherParameters Returns a list of other parameter names on which this parameter is dependent (e.g.
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.
maximum Returns the maximum value acceptable by the parameter.
metadata Returns the parameter’s freeform metadata.
minimum Returns the minimum value acceptable by the parameter.
name Returns the name of the parameter.
provider Returns a pointer to the provider for the algorithm which owns this parameter.
setDataType Sets the acceptable data type for the parameter.
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.
setMaximum Sets the maximum value acceptable by the parameter.
setMetadata Sets the parameter’s freeform metadata.
setMinimum Sets the minimum value acceptable by the parameter.
setName Sets the name of the parameter.
toVariantMap
toolTip
type
typeName Returns the type name for the parameter class.
valueAsPythonString

Attributes

Double
FlagAdvanced
FlagHidden
FlagOptional
Integer
Double = 1
Integer = 0
class Type

Bases: int

checkValueIsAcceptable(self, input: Any, context: QgsProcessingContext = None) → bool
clone(self) → QgsProcessingParameterDefinition
dataType(self) → QgsProcessingParameterNumber.Type

Returns the acceptable data type for the parameter.

See also

setDataType()

fromScriptCode(name: str, description: str, isOptional: bool, definition: str) → QgsProcessingParameterNumber

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

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

Returns the maximum value acceptable by the parameter.

See also

setMaximum()

minimum(self) → float

Returns the minimum value acceptable by the parameter.

See also

setMinimum()

setDataType(self, type: QgsProcessingParameterNumber.Type)

Sets the acceptable data type for the parameter.

See also

dataType()

setMaximum(self, maximum: float)

Sets the maximum value acceptable by the parameter.

See also

maximum()

setMinimum(self, minimum: float)

Sets the minimum value acceptable by the parameter.

See also

minimum()

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

Returns the type name for the parameter class.

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