Class: QgsProcessingParameterDuration

class qgis.core.QgsProcessingParameterDuration

Bases: QgsProcessingParameterNumber

A double numeric parameter for duration values. The returned value will always be in milliseconds.

New in version 3.22.

QgsProcessingParameterDuration(name: str, description: str = ‘’, defaultValue: Any = None, optional: bool = False, minValue: float = -DBL_MAX+1, maxValue: float = DBL_MAX) Constructor for QgsProcessingParameterDuration.

QgsProcessingParameterDuration(QgsProcessingParameterDuration)

Methods

asPythonString

param outputType:

clone

rtype:

QgsProcessingParameterDuration

defaultGuiValueFromSetting

Default gui value for an algorithm parameter from settings

defaultUnit

Returns the default duration unit for the parameter.

fromVariantMap

param map:

setDefaultUnit

Sets the default duration unit for the parameter.

toVariantMap

rtype:

Dict[str, Any]

type

rtype:

str

typeName

Returns the type name for the parameter class.

asPythonString(self, outputType: QgsProcessing.PythonOutputType = QgsProcessing.PythonOutputType.PythonQgsProcessingAlgorithmSubclass) str
Parameters:

outputType (QgsProcessing.PythonOutputType = QgsProcessing.PythonOutputType.PythonQgsProcessingAlgorithmSubclass) –

Return type:

str

clone(self) QgsProcessingParameterDuration
Return type:

QgsProcessingParameterDuration

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.

defaultUnit(self) Qgis.TemporalUnit

Returns the default duration unit for the parameter.

See also

setDefaultUnit()

Return type:

Qgis.TemporalUnit

fromVariantMap(self, map: Dict[str, Any]) bool
Parameters:

map (Dict[str) –

Return type:

bool

setDefaultUnit(self, unit: Qgis.TemporalUnit)

Sets the default duration unit for the parameter.

See also

defaultUnit()

Parameters:

unit (Qgis.TemporalUnit) –

toVariantMap(self) Dict[str, Any]
Return type:

Dict[str, Any]

type(self) str
Return type:

str

typeName() str

Returns the type name for the parameter class.

Return type:

str