Class: QgsProcessingParameterNumber¶
A numeric parameter for processing algorithms.
For numeric parameters with a dataType() of Double, the number
of decimals places shown in the parameter’s widget can be specified by
setting the parameter’s metadata. For example:
param = QgsProcessingParameterNumber( 'VAL', 'Threshold', type=QgsProcessingParameterNumber.Double)
# only show two decimal places in parameter's widgets, not 6:
param.setMetadata( {'widget_wrapper':
  { 'decimals': 2 }
})
Class Hierarchy¶
Base classes¶
Base class for the definition of processing parameters.  | 
Subclasses¶
A double numeric parameter for area values. Linked to a source layer or CRS parameter to determine what units the area values are in.  | 
|
A double numeric parameter for distance values. Linked to a source layer or CRS parameter to determine what units the distance values are in.  | 
|
A double numeric parameter for duration values. The returned value will always be in milliseconds.  | 
|
A double numeric parameter for map scale values.  | 
|
A double numeric parameter for volume values. Linked to a source layer or CRS parameter to determine what units the volume values are in.  | 
Enums
alias of   | 
Methods
Returns the acceptable data type for the parameter.  | 
|
Returns the maximum value acceptable by the parameter.  | 
|
Returns the minimum value acceptable by the parameter.  | 
|
Sets the acceptable data type for the parameter.  | 
|
Sets the maximum value acceptable by the parameter.  | 
|
Sets the minimum value acceptable by the 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.QgsProcessingParameterNumber[source]¶
 Bases:
QgsProcessingParameterDefinition- __init__(name: str | None, description: str | None = '', type: Qgis.ProcessingNumberParameterType = Qgis.ProcessingNumberParameterType.Integer, defaultValue: Any = None, optional: bool = False, minValue: float = -DBL_MAX + 1, maxValue: float = DBL_MAX)
 Constructor for QgsProcessingParameterNumber.
- Parameters:
 name (Optional[str])
description (Optional[str] = '')
type (Qgis.ProcessingNumberParameterType = Qgis.ProcessingNumberParameterType.Integer)
defaultValue (Any = None)
optional (bool = False)
minValue (float = -DBL_MAX+1)
maxValue (float = DBL_MAX)
- __init__(a0: QgsProcessingParameterNumber)
 - Parameters:
 
- Type¶
 alias of
ProcessingNumberParameterType
- dataType(self) Qgis.ProcessingNumberParameterType[source]¶
 Returns the acceptable data type for the parameter.
See also
- Return type:
 
- static fromScriptCode(name: str | None, description: str | None, isOptional: bool, definition: str | None) QgsProcessingParameterNumber | 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[QgsProcessingParameterNumber]
- maximum(self) float[source]¶
 Returns the maximum value acceptable by the parameter.
See also
- Return type:
 float
- minimum(self) float[source]¶
 Returns the minimum value acceptable by the parameter.
See also
- Return type:
 float
- setDataType(self, type: Qgis.ProcessingNumberParameterType)[source]¶
 Sets the acceptable data
typefor the parameter.See also
- Parameters:
 
- setMaximum(self, maximum: float)[source]¶
 Sets the
maximumvalue acceptable by the parameter.See also
- Parameters:
 maximum (float)