Class: QgsProcessingParameterDateTime¶
- class qgis.core.QgsProcessingParameterDateTime¶
Bases:
QgsProcessingParameterDefinition
A datetime (or pure date or time) parameter for processing algorithms.
QgsProcessingParameterDateTime
should be evaluated by callingQgsProcessingAlgorithm.parameterAsDateTime()
, which will return a date time value.New in version 3.14.
QgsProcessingParameterDateTime(name: str, description: str = ‘’, type: Qgis.ProcessingDateTimeParameterDataType = Qgis.ProcessingDateTimeParameterDataType.DateTime, defaultValue: Any = None, optional: bool = False, minValue: Union[QDateTime, datetime.datetime] = QDateTime(), maxValue: Union[QDateTime, datetime.datetime] = QDateTime()) Constructor for QgsProcessingParameterDateTime.
QgsProcessingParameterDateTime(
QgsProcessingParameterDateTime
)Enums
alias of
ProcessingDateTimeParameterDataType
Methods
- param outputType:
- param input:
- rtype:
QgsProcessingParameterDefinition
Returns the acceptable data type for the parameter.
Default gui value for an algorithm parameter from settings
Creates a new parameter using the definition from a script code.
- param map:
Returns the maximum value acceptable by the parameter.
Returns the minimum value acceptable by the parameter.
Sets the acceptable data
type
for the parameter.Sets the
maximum
value acceptable by the parameter.Sets the
minimum
value acceptable by the parameter.- rtype:
Dict[str, Any]
- rtype:
str
- rtype:
str
Returns the type name for the parameter class.
- param value:
- Type¶
alias of
ProcessingDateTimeParameterDataType
- asPythonString(self, outputType: QgsProcessing.PythonOutputType = QgsProcessing.PythonOutputType.PythonQgsProcessingAlgorithmSubclass) str ¶
- Parameters:
outputType (QgsProcessing.PythonOutputType = QgsProcessing.PythonOutputType.PythonQgsProcessingAlgorithmSubclass) –
- Return type:
str
- checkValueIsAcceptable(self, input: Any, context: QgsProcessingContext = None) bool ¶
- Parameters:
input (Any) –
context (
QgsProcessingContext
= None) –
- Return type:
bool
- clone(self) QgsProcessingParameterDefinition ¶
- Return type:
- dataType(self) Qgis.ProcessingDateTimeParameterDataType ¶
Returns the acceptable data type for the parameter.
See also
- Return type:
- 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.
- fromScriptCode(name: str, description: str, isOptional: bool, definition: str) QgsProcessingParameterDateTime ¶
Creates a new parameter using the definition from a script code.
- Parameters:
name (str) –
description (str) –
isOptional (bool) –
definition (str) –
- Return type:
- fromVariantMap(self, map: Dict[str, Any]) bool ¶
- Parameters:
map (Dict[str) –
- Return type:
bool
- maximum(self) QDateTime ¶
Returns the maximum value acceptable by the parameter.
An invalid QDateTime value indicates no maximum value.
See also
- Return type:
QDateTime
- minimum(self) QDateTime ¶
Returns the minimum value acceptable by the parameter.
An invalid QDateTime value indicates no minimum value.
See also
- Return type:
QDateTime
- setDataType(self, type: Qgis.ProcessingDateTimeParameterDataType)¶
Sets the acceptable data
type
for the parameter.See also
- Parameters:
- setMaximum(self, maximum: QDateTime | datetime.datetime)¶
Sets the
maximum
value acceptable by the parameter.An invalid QDateTime value indicates no maximum value.
If the
dataType()
is QgsProcessingParameterDateTime.Time, then the date component ofmaximum
must be set to any valid date (but this date will not actually be considered when comparing parameter values to the specified maximum value, only the time component will be considered).See also
- Parameters:
maximum (Union[QDateTime) –
- setMinimum(self, minimum: QDateTime | datetime.datetime)¶
Sets the
minimum
value acceptable by the parameter.An invalid QDateTime value indicates no minimum value.
If the
dataType()
is QgsProcessingParameterDateTime.Time, then the date component ofminimum
must be set to any valid date (but this date will not actually be considered when comparing parameter values to the specified minimum value, only the time component will be considered).See also
- Parameters:
minimum (Union[QDateTime) –
- toVariantMap(self) Dict[str, Any] ¶
- Return type:
Dict[str, Any]
- toolTip(self) str ¶
- Return type:
str
- type(self) str ¶
- Return type:
str
- typeName() str ¶
Returns the type name for the parameter class.
- Return type:
str
- valueAsPythonString(self, value: Any, context: QgsProcessingContext) str ¶
- Parameters:
value (Any) –
context (QgsProcessingContext) –
- Return type:
str