QTime Class Reference

#include <qdatetime.h>

Class Description

Definition at line 148 of file qdatetime.h.

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 QDataStreamoperator<< (QDataStream &, const QTime &)
 
Q_CORE_EXPORT QDataStreamoperator>> (QDataStream &, QTime &)
 

Constructor & Destructor Documentation

QTime ( )
inline

Definition at line 151 of file qdatetime.h.

151  : mds(NullTime)
152 #if defined(Q_OS_WINCE)
153  , startTick(NullTime)
154 #endif
155  {}
QTime ( int  h,
int  m,
int  s = 0,
int  ms = 0 
)

Member Function Documentation

bool isNull ( ) const
inline

Definition at line 158 of file qdatetime.h.

158 { return mds == NullTime; }
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
inline

Definition at line 176 of file qdatetime.h.

176 { return mds == other.mds; }
bool operator!= ( const QTime other) const
inline

Definition at line 177 of file qdatetime.h.

177 { return mds != other.mds; }
bool operator< ( const QTime other) const
inline

Definition at line 178 of file qdatetime.h.

178 { return mds < other.mds; }
bool operator<= ( const QTime other) const
inline

Definition at line 179 of file qdatetime.h.

179 { return mds <= other.mds; }
bool operator> ( const QTime other) const
inline

Definition at line 180 of file qdatetime.h.

180 { return mds > other.mds; }
bool operator>= ( const QTime other) const
inline

Definition at line 181 of file qdatetime.h.

181 { return mds >= other.mds; }
static QTime currentTime ( )
static
static QTime fromString ( const QString s,
Qt::DateFormat  f = Qt::TextDate 
)
static
static QTime fromString ( const QString s,
const QString format 
)
static
static bool isValid ( int  h,
int  m,
int  s,
int  ms = 0 
)
static
void start ( )
int restart ( )
int elapsed ( ) const

Friends And Related Function Documentation

friend class QDateTime
friend

Definition at line 205 of file qdatetime.h.

friend class QDateTimePrivate
friend

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: