libkdegames
#include <KGameClock>
Public Types | |
enum | ClockType { HourMinSec = 0, MinSecOnly } |
Public Slots | |
virtual void | pause () |
virtual void | restart () |
virtual void | resume () |
Signals | |
void | timeChanged (const QString &) |
Public Member Functions | |
KGameClock (QObject *parent=0, ClockType clocktype=HourMinSec) | |
virtual | ~KGameClock () |
uint | seconds () const |
void | setTime (uint seconds) |
void | setTime (const QString &s) |
void | showTime () |
QString | timeString () const |
Protected Slots | |
virtual void | timeoutClock () |
Detailed Description
Class representing a game clock, wraps after 24 hours.
Definition at line 35 of file kgameclock.h.
Member Enumeration Documentation
Enumerator | |
---|---|
HourMinSec | |
MinSecOnly |
Definition at line 39 of file kgameclock.h.
Constructor & Destructor Documentation
|
explicit |
- Returns
- Constructor
Definition at line 40 of file kgameclock.cpp.
|
virtual |
Definition at line 48 of file kgameclock.cpp.
Member Function Documentation
|
virtualslot |
Pause the clock.
Definition at line 98 of file kgameclock.cpp.
|
virtualslot |
Reset the clock and start again from zero.
Definition at line 83 of file kgameclock.cpp.
|
virtualslot |
Resume counting time from the current position.
Definition at line 93 of file kgameclock.cpp.
uint KGameClock::seconds | ( | ) | const |
- Returns
- the total number of seconds elapsed.
Definition at line 103 of file kgameclock.cpp.
void KGameClock::setTime | ( | uint | seconds | ) |
Set the time.
Definition at line 108 of file kgameclock.cpp.
void KGameClock::setTime | ( | const QString & | s | ) |
Set the time (format should be "hh:mm:ss").
Definition at line 117 of file kgameclock.cpp.
void KGameClock::showTime | ( | ) |
Refresh.
Definition at line 78 of file kgameclock.cpp.
|
signal |
|
protectedvirtualslot |
Definition at line 53 of file kgameclock.cpp.
QString KGameClock::timeString | ( | ) | const |
- Returns
- the time as a string to be displayed: "mm:ss" or "hh:mm:ss" depending on clock type.
Definition at line 68 of file kgameclock.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:44:35 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.