- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Friends

# QTime Class Reference

Search for all occurrences

## Detailed Description

Definition at line 148 of file qdatetime.h.

`#include <qdatetime.h>`

List of all members.

## Public Member Functions
| QTime ()
| QTime (int h, int m, int s=0, int ms=0)
bool | isNull () const
bool | isValid () const
int | hour () const
int | minute () const
int | second () const
int | msec () const
QString | toString (Qt::DateFormat f=Qt::TextDate) const
QString | toString (const QString &format) const
bool | setHMS (int h, int m, int s, int ms=0)
QTime | addSecs (int secs) const
int | secsTo (const QTime &) const
QTime | addMSecs (int ms) const
int | msecsTo (const QTime &) const
bool | operator== (const QTime &other) const
bool | operator!= (const QTime &other) const
bool | operator< (const QTime &other) const
bool | operator<= (const QTime &other) const
bool | operator> (const QTime &other) const
bool | operator>= (const QTime &other) const
void | start ()
int | restart ()
int | elapsed () const
## Static Public Member Functions
static QTime | currentTime ()
static QTime | fromString (const QString &s, Qt::DateFormat f=Qt::TextDate)
static QTime | fromString (const QString &s, const QString &format)
static bool | isValid (int h, int m, int s, int ms=0)
## Friends
class | QDateTime
class | QDateTimePrivate
Q_CORE_EXPORT QDataStream & | operator<< (QDataStream &, const QTime &)
Q_CORE_EXPORT QDataStream & | operator>> (QDataStream &, QTime &)

## Constructor & Destructor Documentation

QTime | ( |  | ) | `[inline]`

Definition at line 151 of file qdatetime.h.

               : mds(NullTime)
    #if defined(Q_OS_WINCE)
            , startTick(NullTime)
    #endif
        {}

QTime | ( | int | h,
|  | int | m,
|  | int | s = `0`,
|  | int | ms = `0`
| ) |  |

## Member Function Documentation

bool isNull | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 158 of file qdatetime.h.

    { return mds == NullTime; }

bool isValid | ( |  | ) | const

Search for all occurrences

int hour | ( |  | ) | const

Search for all occurrences

int minute | ( |  | ) | const

Search for all occurrences

int second | ( |  | ) | const

Search for all occurrences

int msec | ( |  | ) | const

Search for all occurrences

QString toString | ( | Qt::DateFormat | f = `Qt::TextDate` | ) | const

Search for all occurrences

QString toString | ( | const QString & | format | ) | const

Search for all occurrences

bool setHMS | ( | int | h,
|  | int | m,
|  | int | s,
|  | int | ms = `0`
| ) |  |

Search for all occurrences

QTime addSecs | ( | int | secs | ) | const

Search for all occurrences

int secsTo | ( | const QTime & |  | ) | const

Search for all occurrences

QTime addMSecs | ( | int | ms | ) | const

Search for all occurrences

int msecsTo | ( | const QTime & |  | ) | const

Search for all occurrences

bool operator== | ( | const QTime & | other | ) | const `[inline]`

Definition at line 176 of file qdatetime.h.

    { return mds == other.mds; }

bool operator!= | ( | const QTime & | other | ) | const `[inline]`

Definition at line 177 of file qdatetime.h.

    { return mds != other.mds; }

bool operator< | ( | const QTime & | other | ) | const `[inline]`

Definition at line 178 of file qdatetime.h.

    { return mds < other.mds; }

bool operator<= | ( | const QTime & | other | ) | const `[inline]`

Definition at line 179 of file qdatetime.h.

    { return mds <= other.mds; }

bool operator> | ( | const QTime & | other | ) | const `[inline]`

Definition at line 180 of file qdatetime.h.

    { return mds > other.mds; }

bool operator>= | ( | const QTime & | other | ) | const `[inline]`

Definition at line 181 of file qdatetime.h.

    { return mds >= other.mds; }

static QTime currentTime | ( |  | ) | `[static]`

Search for all occurrences

static QTime fromString | ( | const QString & | s,
|  | Qt::DateFormat | f = `Qt::TextDate`
| ) |  | `[static]`

Search for all occurrences

static QTime fromString | ( | const QString & | s,
|  | const QString & | format
| ) |  | `[static]`

Search for all occurrences

static bool isValid | ( | int | h,
|  | int | m,
|  | int | s,
|  | int | ms = `0`
| ) |  | `[static]`

Search for all occurrences

void start | ( |  | ) |

Search for all occurrences

int restart | ( |  | ) |

Search for all occurrences

int elapsed | ( |  | ) | const

Search for all occurrences

## Friends And Related Function Documentation

friend class QDateTime `[friend]`

Search for all occurrences

Definition at line 205 of file qdatetime.h.

friend class QDateTimePrivate `[friend]`

Search for all occurrences

Definition at line 206 of file qdatetime.h.

Q_CORE_EXPORT QDataStream& operator<< | ( | QDataStream & | ,
|  | const QTime & |
| ) |  | `[friend]`

Q_CORE_EXPORT QDataStream& operator>> | ( | QDataStream & | ,
|  | QTime & |
| ) |  | `[friend]`

The documentation for this class was generated from the following file:

- QtCore/qdatetime.h

QTime QTime QTime QTime QTime QTime QTime QTime QTime QTime
QTime QTime QTime QTime QTime QTime QTime QTime QTime QTime