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: QgsProcessingParameterDateTime.Type = QgsProcessingParameterDateTime.DateTime, defaultValue: Any = None, optional: bool = False, minValue: Union[QDateTime, datetime.datetime] = QDateTime(), maxValue: Union[QDateTime, datetime.datetime] = QDateTime()) Constructor for QgsProcessingParameterDateTime.
QgsProcessingParameterDateTime(
QgsProcessingParameterDateTime
)Methods
- param outputType
- param input
- rtype
QgsProcessingParameterDefinition
Returns the acceptable data type for the parameter.
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
Attributes
- Date = 1¶
- DateTime = 0¶
- Time = 2¶
- class Type¶
Bases:
int
- asPythonString(self, outputType: QgsProcessing.PythonOutputType = QgsProcessing.PythonQgsProcessingAlgorithmSubclass) str ¶
- Parameters
outputType (QgsProcessing.PythonOutputType = QgsProcessing.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) QgsProcessingParameterDateTime.Type ¶
Returns the acceptable data type for the parameter.
See also
- Return type
- 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: QgsProcessingParameterDateTime.Type)¶
Sets the acceptable data
type
for the parameter.See also
- Parameters
type (QgsProcessingParameterDateTime.Type) –
- setMaximum(self, maximum: Union[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: Union[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