Class: QgsProcessingParameterArea¶
A double numeric parameter for area values.
Linked to a source layer or CRS parameter to determine what units the area values are in.
The number of decimals places shown in a area parameter’s widget can be specified by setting the parameter’s metadata. For example:
param = QgsProcessingParameterArea( '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 area unit for the parameter. |
|
Returns the name of the parent parameter, or an empty string if this is not set. |
|
Sets the default area unit for the parameter. |
|
Sets the name of the parent layer parameter. |
- class qgis.core.QgsProcessingParameterArea[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 QgsProcessingParameterArea.
- 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: QgsProcessingParameterArea)
- Parameters:
- defaultUnit(self) Qgis.AreaUnit [source]¶
Returns the default area 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.AreaUnit)[source]¶
Sets the default area
unit
for the parameter.See also
- Parameters:
unit (Qgis.AreaUnit)