Class: QgsProcessingParameterVolume¶
A double numeric parameter for volume values.
Linked to a source layer or CRS parameter to determine what units the volume values are in.
The number of decimals places shown in a volume parameter’s widget can be specified by setting the parameter’s metadata. For example:
param = QgsProcessingParameterVolume( 'VAL', 'Threshold')
# only show two decimal places in parameter's widgets, not 6:
param.setMetadata( {'widget_wrapper':
{ 'decimals': 2 }
})
Added in version 3.40.
Class Hierarchy¶
Base classes¶
A numeric parameter for processing algorithms. |
|
Base class for the definition of processing parameters. |
Methods
Returns the default volume unit for the parameter. |
|
Returns the name of the parent parameter, or an empty string if this is not set. |
|
Sets the default volume unit for the parameter. |
|
Sets the name of the parent layer parameter. |
- class qgis.core.QgsProcessingParameterVolume[source]¶
Bases:
QgsProcessingParameterNumber
- __init__(name: str | None, description: str | None = '', defaultValue: Any = None, parentParameterName: str | None = '', optional: bool = False, minValue: float = 0, maxValue: float = DBL_MAX)
Constructor for QgsProcessingParameterVolume.
- Parameters:
name (Optional[str])
description (Optional[str] = '')
defaultValue (Any = None)
parentParameterName (Optional[str] = '')
optional (bool = False)
minValue (float = 0)
maxValue (float = DBL_MAX)
- __init__(a0: QgsProcessingParameterVolume)
- Parameters:
- defaultUnit(self) Qgis.VolumeUnit [source]¶
Returns the default volume unit for the parameter.
See also
- Return type:
- parentParameterName(self) str [source]¶
Returns the name of the parent parameter, or an empty string if this is not set.
See also
- Return type:
str
- setDefaultUnit(self, unit: Qgis.VolumeUnit)[source]¶
Sets the default volume
unit
for the parameter.See also
- Parameters:
unit (Qgis.VolumeUnit)