Class: QgsProcessingParameterDistance¶
-
class
qgis.core.
QgsProcessingParameterDistance
(name: str, description: str = '', defaultValue: Any = None, parentParameterName: str = '', optional: bool = False, minValue: float = -DBL_MAX+1, maxValue: float = DBL_MAX)¶ Bases:
qgis._core.QgsProcessingParameterNumber
Constructor for QgsProcessingParameterDistance.
QgsProcessingParameterDistance(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 } })
New in version 3.2: Enums
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.
Returns the type name for the parameter class.
Signals
Attributes
-
asPythonString
(self, outputType: QgsProcessing.PythonOutputType = QgsProcessing.PythonQgsProcessingAlgorithmSubclass) → str¶
-
clone
(self) → QgsProcessingParameterDistance¶
-
defaultUnit
(self) → QgsUnitTypes.DistanceUnit¶ Returns the default distance unit for the parameter.
See also
New in version 3.4.3.
-
dependsOnOtherParameters
(self) → List[str]¶
-
fromVariantMap
(self, map: Dict[str, Any]) → bool¶
-
parentParameterName
(self) → str¶ Returns the name of the parent parameter, or an empty string if this is not set.
See also
-
setDefaultUnit
(self, unit: QgsUnitTypes.DistanceUnit)¶ Sets the default distance
unit
for the parameter.See also
New in version 3.4.3.
-
setParentParameterName
(self, parentParameterName: str)¶ Sets the name of the parent layer parameter. Use an empty string if this is not required.
See also
-
toVariantMap
(self) → Dict[str, Any]¶
-
type
(self) → str¶
-
typeName
() → str¶ Returns the type name for the parameter class.
-