Class: QgsDateTimeWithTimeZoneWidget

A date time widget with time zone control.

Added in version 4.4.

List of all members, including inherited members

Class Hierarchy

Inheritance diagram of qgis.gui.QgsDateTimeWithTimeZoneWidget

Base classes

QWidget

QObject

QPaintDevice

Constructor

__init__

Methods

dateTime

Returns the date time shown in the widget, with corresponding time zone set.

dateTimeEdit

Returns the date time edit portion of the widget.

dialogTitle

Returns the title for the time zone selector dialog window.

setDateTime

Sets the date time to show in the widget.

setDialogTitle

Sets the title for the time zone selector dialog window.

timeZoneComboBox

Returns the time zone combo box portion of the widget.

Signals

dateTimeChanged

Emitted whenever the date time shown in the widget is changed.

class qgis.gui.QgsDateTimeWithTimeZoneWidget[source]

Bases: QWidget

__init__(parent: QWidget | None = None)

Constructor for QgsDateTimeWithTimeZoneWidget, with the specified parent widget.

Parameters:

parent (QWidget|None = None)

dateTime(self) → QDateTime[source]

Returns the date time shown in the widget, with corresponding time zone set.

See also

setDateTime()

Return type:

QDateTime

signal dateTimeChanged(dateTime: QDateTime)[source]

Emitted whenever the date time shown in the widget is changed.

Parameters:

dateTime (QDateTime)

dateTimeEdit(self) → QgsDateTimeEdit | None[source]

Returns the date time edit portion of the widget.

Warning

Do not directly set or retrieve the date time from this widget, as it will not respect the time zone portion of the widget.

Return type:

QgsDateTimeEdit|None

dialogTitle(self) → str[source]

Returns the title for the time zone selector dialog window.

See also

setDialogTitle()

Return type:

str

setDateTime(self, dateTime: QDateTime | datetime.datetime)[source]

Sets the date time to show in the widget.

The time zone will be automatically set to match the time zone of this date time value.

See also

dateTime()

Parameters:

dateTime (QDateTime|datetime.datetime)

setDialogTitle(self, title: str | None)[source]

Sets the title for the time zone selector dialog window.

See also

dialogTitle()

Parameters:

title (str|None)

timeZoneComboBox(self) → QgsTimeZoneComboBox | None[source]

Returns the time zone combo box portion of the widget.

Return type:

QgsTimeZoneComboBox|None