The QTime class provides time functions 24 hours a day. More...
#include <qdatetime.h>
The time resolution of QTime is a millisecond, although the accuracy depends on the underlying operating system. Some operating systems (e.g. Linux and Window NT) support a one-millisecond resolution, while others (MS-DOS and Windows 3.1) support only a 55 millisecond resolution.
See also: QDate and QDateTime.
Examples: tictac/tictac.cpp aclock/aclock.cpp
Constructs a time 00:00:00.000, which is valid.
Constructs a time with hour h, minute m, seconds s and milliseconds ms.
Returns the time plus ms milliseconds.
Returns the time plus nsecs seconds.
See also: secsTo().
[static]
Returns the current time.
Returns the number of milliseconds that have elapsed since start() or restart() were called.
See also: start() and restart().
Returns the hour part (0..23) of the time.
Examples: tictac/tictac.cpp
Returns TRUE if the time is equal to 00:00:00.000. A null time is valid.
See also: isValid().
Returns TRUE if the time is valid, or FALSE if the time is invalid. The time 23:30:55.746 is valid, while 24:12:30 is invalid.
See also: isNull().
[static]
Returns TRUE if the specified time is valid, otherwise FALSE.
Example:
QTime::isValid(21, 10, 30); // returns TRUE QTime::isValid(22, 5, 62); // returns FALSE
Returns the minute part (0..59) of the time.
Examples: tictac/tictac.cpp aclock/aclock.cpp
Returns the millisecond part (0..999) of the time.
Returns the number of milliseconds between this time and t.
Returns TRUE if this time is different from t, or FALSE if they are equal.
Returns TRUE if this time is before t, otherwise FALSE.
Returns TRUE if this time is before or equal to t, otherwise FALSE.
Returns TRUE if this time is equal to t, or FALSE if they are different.
Returns TRUE if this time is after t, otherwise FALSE.
Returns TRUE if this time is equal to or after t, otherwise FALSE.
Sets *this to the current time, and returns the number of milliseconds that have elapsed since the last start() or restart().
restart is guaranteed to be atomic, and so is very handy for repeated measurements; call start() to start the first measurement, then restart() for each later measurement.
See also: start() and elapsed().
Returns the second part (0..59) of the time.
Examples: tictac/tictac.cpp
Returns the number of seconds from this time to t (which is negative if t is in the past).
Since QTime measures time within a day and there are 86400 seconds in a day, the result is between -86400 and 86400.
See also: addSecs() and QDateTime::secsTo().
Sets the hour h, minute m, seconds s and milliseconds ms. Returns TRUE if the time is valid, otherwise FALSE.
Sets the time to the current time, e.g. for timing:
QTime t; t.start(); // start clock ... // some lengthy task debug( "%d\n", t.elapsed() ); // prints # msecs elapsed
See also: restart() and elapsed().
Converts the date to a string, which is returned. Milliseconds are not included. The string format is "03:40:13".
Writes a time to the stream.
Serialization format: [Q_UINT32], milliseconds since midnight.
Reads a time from the stream.
Search the documentation, FAQ, qt-interest archive and more (uses
www.troll.no):
This file is part of the Qt toolkit, copyright © 1995-98 Troll Tech, all rights reserved.
It was generated from the following files:
Copyright İ 1998 Troll Tech | Trademarks | Qt version 1.42
|