Class: QgsProcessingParameterNumber¶
-
class
qgis.core.
QgsProcessingParameterNumber
(name: str, description: str = '', type: QgsProcessingParameterNumber.Type = QgsProcessingParameterNumber.Integer, defaultValue: Any = None, optional: bool = False, minValue: float = -DBL_MAX+1, maxValue: float = DBL_MAX)¶ Bases:
qgis._core.QgsProcessingParameterDefinition
Constructor for QgsProcessingParameterNumber.
QgsProcessingParameterNumber(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=QgsProcessingParameter.Double) # only show two decimal places in parameter's widgets, not 6: param.setMetadata( {'widget_wrapper': { 'decimals': 2 } })
New in version 3.0: Enums
Methods
Returns the acceptable data type for the parameter.
Creates a new parameter using the definition from a script code.
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.Returns the type name for the parameter class.
Signals
Attributes
-
Double
= 1¶
-
Integer
= 0¶
-
class
Type
¶ Bases:
int
-
asPythonString
(self, outputType: QgsProcessing.PythonOutputType = QgsProcessing.PythonQgsProcessingAlgorithmSubclass) → str¶
-
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
-
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
-
minimum
(self) → float¶ Returns the minimum value acceptable by the parameter.
See also
-
setDataType
(self, type: QgsProcessingParameterNumber.Type)¶ Sets the acceptable data
type
for the parameter.See also
-
setMaximum
(self, maximum: float)¶ Sets the
maximum
value acceptable by the parameter.See also
-
setMinimum
(self, minimum: float)¶ Sets the
minimum
value acceptable by the parameter.See also
-
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¶
-