Class: QgsTimeEdit

A QTimeEdit widget with the capability of setting/reading null date/times.

Warning

You should use the signal timeValueChanged of this subclass rather than QDateTimeEdit.timeChanged. (If you consequently connect parent’s timeChanged signal and call time() afterwards there is no guarantee that NULL values will be correctly handled).

See also

QgsDateTimeEdit

See also

QgsDateEdit

Added in version 3.14.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsTimeEdit

Base classes

QgsDateTimeEdit

A QDateTimeEdit with the capability of setting/reading null date/times.

QDateTimeEdit

QAbstractSpinBox

QWidget

QObject

QPaintDevice

class qgis.gui.QgsTimeEdit[source]

Bases: QgsDateTimeEdit

__init__(parent: QWidget | None = None)

Constructor for QgsTimeEdit. The current time is used by default. The widget is allowing null by default. If allow null is disabled, you should check allowNull before getting values from the widget.

Parameters:

parent (Optional[QWidget] = None)

setTime(self, time: QTime | datetime.time)[source]

Sets the time for the widget and handles null times.

Note

Since QDateTimeEdit.setTime() is not virtual, setTime must be called for QgsTimeEdit.

Parameters:

time (Union[QTime, datetime.time])

signal timeValueChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.