Class: QgsProcessingParameterNumber¶
- class qgis.core.QgsProcessingParameterNumber¶
Bases:
QgsProcessingParameterDefinition
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 } })
QgsProcessingParameterNumber(name: str, description: str = ‘’, type: Qgis.ProcessingNumberParameterType = Qgis.ProcessingNumberParameterType.Integer, defaultValue: Any = None, optional: bool = False, minValue: float = -DBL_MAX+1, maxValue: float = DBL_MAX) Constructor for QgsProcessingParameterNumber.
QgsProcessingParameterNumber(
QgsProcessingParameterNumber
)Enums
alias of
ProcessingNumberParameterType
Methods
- param outputType:
- param input:
- rtype:
QgsProcessingParameterDefinition
Returns the acceptable data type for the parameter.
Default gui value for an algorithm parameter from settings
Creates a new parameter using the definition from a script code.
- param map:
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.- rtype:
Dict[str, Any]
- rtype:
str
- rtype:
str
Returns the type name for the parameter class.
- param value:
- Type¶
alias of
ProcessingNumberParameterType
- asPythonString(self, outputType: QgsProcessing.PythonOutputType = QgsProcessing.PythonOutputType.PythonQgsProcessingAlgorithmSubclass) str ¶
- Parameters:
outputType (QgsProcessing.PythonOutputType = QgsProcessing.PythonOutputType.PythonQgsProcessingAlgorithmSubclass) –
- Return type:
str
- checkValueIsAcceptable(self, input: Any, context: QgsProcessingContext = None) bool ¶
- Parameters:
input (Any) –
context (
QgsProcessingContext
= None) –
- Return type:
bool
- clone(self) QgsProcessingParameterDefinition ¶
- Return type:
- dataType(self) Qgis.ProcessingNumberParameterType ¶
Returns the acceptable data type for the parameter.
See also
- Return type:
- defaultGuiValueFromSetting(self) Any ¶
Default gui value for an algorithm parameter from settings
- Returns:
default value from settings or invalid QVariant if there is no default value defined in the settings
New in version 3.34.
- fromScriptCode(name: str, description: str, isOptional: bool, definition: str) QgsProcessingParameterNumber ¶
Creates a new parameter using the definition from a script code.
- Parameters:
name (str) –
description (str) –
isOptional (bool) –
definition (str) –
- Return type:
- fromVariantMap(self, map: Dict[str, Any]) bool ¶
- Parameters:
map (Dict[str) –
- Return type:
bool
- maximum(self) float ¶
Returns the maximum value acceptable by the parameter.
See also
- Return type:
float
- minimum(self) float ¶
Returns the minimum value acceptable by the parameter.
See also
- Return type:
float
- setDataType(self, type: Qgis.ProcessingNumberParameterType)¶
Sets the acceptable data
type
for the parameter.See also
- Parameters:
type (Qgis.ProcessingNumberParameterType) –
- setMaximum(self, maximum: float)¶
Sets the
maximum
value acceptable by the parameter.See also
- Parameters:
maximum (float) –
- setMinimum(self, minimum: float)¶
Sets the
minimum
value acceptable by the parameter.See also
- Parameters:
minimum (float) –
- toVariantMap(self) Dict[str, Any] ¶
- Return type:
Dict[str, Any]
- toolTip(self) str ¶
- Return type:
str
- type(self) str ¶
- Return type:
str
- typeName() str ¶
Returns the type name for the parameter class.
- Return type:
str
- valueAsPythonString(self, value: Any, context: QgsProcessingContext) str ¶
- Parameters:
value (Any) –
context (QgsProcessingContext) –
- Return type:
str