Skip to content

PythonQt.QtCore.QTime

QTime

PythonQtInstanceWrapper object

Native bases: PythonQtInstanceWrapper

Supplemental documentation: Qt 5 reference:

Detailed Description

A QTime object contains a clock time, which it can express as the numbers of hours, minutes, seconds, and milliseconds since midnight. It provides functions for comparing times and for manipulating a time by adding a number of milliseconds.

QTime uses the 24-hour clock format; it has no concept of AM/PM. Unlike QDateTime, QTime knows nothing about time zones or daylight-saving time (DST).

A QTime object is typically created either by giving the number of hours, minutes, seconds, and milliseconds explicitly, or by using the static function currentTime(), which creates a QTime object that represents the system's local time.

The hour(), minute(), second(), and msec() functions provide access to the number of hours, minutes, seconds, and milliseconds of the time. The same information is provided in textual format by the toString() function.

The addSecs() and addMSecs() functions provide the time a given number of seconds or milliseconds later than a given time. Correspondingly, the number of seconds or milliseconds between two times can be found using secsTo() or msecsTo().

QTime provides a full set of operators to compare two QTime objects; an earlier time is considered smaller than a later one; if A.msecsTo(B) is positive, then A \< B.

Source: https://doc.qt.io/archives/qt-5.15/qtime.html

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
__init__ function (self, *args: Any, **kwargs: Any) -> None Native constructor; consult class documentation for supported overloads. (shared captured text)
addMSecs function (self, ms: int) -> Any X.addMSecs(ms) -> PythonQt.QtCore.QTime
addSecs function (self, secs: int) -> Any X.addSecs(secs) -> PythonQt.QtCore.QTime
className function (self, *args: Any, **kwargs: Any) -> Any Return the classname of the object (shared captured text)
currentTime function (self) -> Any X.currentTime() -> PythonQt.QtCore.QTime
delete function (self, *args: Any, **kwargs: Any) -> Any Deletes the C++ object (at your own risk, my friend!) (shared captured text)
elapsed function (self) -> int X.elapsed() -> int
fromMSecsSinceStartOfDay function (self, msecs: int) -> Any X.fromMSecsSinceStartOfDay(msecs) -> PythonQt.QtCore.QTime
fromString function (self, s: str, f: Any) -> Any X.fromString(s, f) -> PythonQt.QtCore.QTime
help function (self, *args: Any, **kwargs: Any) -> Any Shows the help of available methods for this class (shared captured text)
hour function (self) -> int X.hour() -> int
inherits function (self, *args: Any, **kwargs: Any) -> Any Returns if the class inherits or is of given type name (shared captured text)
isNull function (self) -> bool X.isNull() -> bool
isValid function (self, m: Any, s: Any, ms: Any) -> bool X.isValid(m, s, ms) -> bool
minute function (self) -> int X.minute() -> int
msec function (self) -> int X.msec() -> int
msecsSinceStartOfDay function (self) -> int X.msecsSinceStartOfDay() -> int
msecsTo function (self, arg__1: Any) -> int X.msecsTo(arg__1) -> int
readFrom function (self, arg__1: Any) -> Any (shared captured text)
restart function (self) -> int X.restart() -> int
second function (self) -> int X.second() -> int
secsTo function (self, arg__1: Any) -> int X.secsTo(arg__1) -> int
setHMS function (self, h: int, m: int, s: int, ms: int) -> bool X.setHMS(h, m, s, ms) -> bool
start function (self) -> None
toString function (self, f: Any) -> str X.toString(f) -> str
writeTo function (self, arg__1: Any) -> Any (shared captured text)