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