KGameClock
#include <KGameClock>
Public Types | |
enum | ClockType { HourMinSec = 0 , MinSecOnly = 1 , FlexibleHourMinSec = 2 , LongMinSec = 3 } |
Signals | |
void | timeChanged (const QString &) |
Public Slots | |
virtual void | pause () |
virtual void | restart () |
virtual void | resume () |
Protected Slots | |
virtual void | timeoutClock () |
Detailed Description
Class representing a game clock.
Definition at line 27 of file kgameclock.h.
Member Enumeration Documentation
◆ ClockType
Controls the format of return value of timeString()
Format Example1 Example2
HourMinSec 00:04:05 01:02:03 MinSecOnly 04:05 02:03 FlexibleHourMinSec 04:05 01:02:03 LongMinSec 04:05 62:03
Enumerator | |
---|---|
FlexibleHourMinSec |
|
LongMinSec |
|
Definition at line 41 of file kgameclock.h.
Constructor & Destructor Documentation
◆ KGameClock()
|
explicit |
- Returns
- Constructor
Definition at line 46 of file kgameclock.cpp.
Member Function Documentation
◆ pause
|
virtualslot |
Pause the clock.
Definition at line 109 of file kgameclock.cpp.
◆ restart
|
virtualslot |
Reset the clock and start again from zero.
Definition at line 92 of file kgameclock.cpp.
◆ resume
|
virtualslot |
Resume counting time from the current position.
Definition at line 102 of file kgameclock.cpp.
◆ seconds()
uint KGameClock::seconds | ( | ) | const |
- Returns
- the total number of seconds elapsed.
Definition at line 116 of file kgameclock.cpp.
◆ setTime() [1/2]
Set the time.
Format should be "hh:mm:ss" (or "mm:ss"
- Since
- 22.04).
Definition at line 131 of file kgameclock.cpp.
◆ setTime() [2/2]
void KGameClock::setTime | ( | uint | seconds | ) |
Set the time.
Definition at line 123 of file kgameclock.cpp.
◆ showTime()
void KGameClock::showTime | ( | ) |
Refresh.
Definition at line 87 of file kgameclock.cpp.
◆ timeoutClock
|
protectedvirtualslot |
Definition at line 59 of file kgameclock.cpp.
◆ timeString()
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 67 of file kgameclock.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:16:50 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.