|
FotoBox
|
#include <countdown.h>
Inheritance diagram for FotoBox::Countdown:
Collaboration diagram for FotoBox::Countdown:Signals | |
| void | update (unsigned int) |
| Update countdown. More... | |
| void | elapsed () |
| Countdown elapsed. More... | |
Public Member Functions | |
| Countdown (QObject *parent=nullptr, unsigned int i_seconds=0) | |
| Countdown constructor. More... | |
| ~Countdown () override=default | |
| Countdown default destructor. More... | |
| Countdown (const Countdown &other)=delete | |
| Countdown default copy constructor. More... | |
| Countdown & | operator= (const Countdown &other)=delete |
| Countdown default copy assignment. More... | |
| Countdown (Countdown &&other)=delete | |
| Countdown default move constructor. More... | |
| Countdown & | operator= (Countdown &&other)=delete |
| Countdown default move assignment. More... | |
| void | setStartTime (unsigned int i_seconds) |
| Set the countdown start time. More... | |
| auto | isActive () const -> bool |
| Show countdown status. More... | |
| auto | start () -> bool |
| Start countdown. More... | |
| auto | stop () -> bool |
| Stop countdown and check. More... | |
| auto | reset () -> bool |
| Reset countdown (reset. More... | |
Private Member Functions | |
| void | updateTimeLeft () |
| Start the timer until there is no time left, means. More... | |
Private Attributes | |
| QTimer | m_timer |
| unsigned int | m_startTime |
| unsigned int | m_timeLeft |
| bool | m_isActive {false} |
Static Private Attributes | |
| static constexpr int | ONE_SECOND = 1000 |
The Countdown class.
Provides a countdown which operates on the base of seconds
Definition at line 20 of file countdown.h.
|
explicit |
Countdown constructor.
| parent | QObject |
| i_seconds | set the start time |
Definition at line 12 of file countdown.cpp.
References m_timer, ONE_SECOND, and updateTimeLeft().
Here is the call graph for this function:
|
overridedefault |
Countdown default destructor.
|
signal |
Countdown elapsed.
Referenced by FotoBox::FotoBox::countdown(), FotoBox::Preferences::Preferences(), and updateTimeLeft().
Here is the caller graph for this function:| auto FotoBox::Countdown::isActive | ( | ) | const -> bool |
Show countdown status.
Definition at line 52 of file countdown.cpp.
References m_isActive.
Countdown default copy assignment.
Countdown default move assignment.
| auto FotoBox::Countdown::reset | ( | ) | -> bool |
Reset countdown (reset.
Will also
Definition at line 88 of file countdown.cpp.
Referenced by setStartTime().
Here is the caller graph for this function:| void FotoBox::Countdown::setStartTime | ( | unsigned int | i_seconds | ) |
Set the countdown start time.
| i_seconds | setter |
Definition at line 46 of file countdown.cpp.
References m_startTime, and reset().
Here is the call graph for this function:| auto FotoBox::Countdown::start | ( | ) | -> bool |
Start countdown.
only start if not running
Definition at line 57 of file countdown.cpp.
Referenced by FotoBox::FotoBox::countdown(), and FotoBox::Preferences::Preferences().
Here is the caller graph for this function:| auto FotoBox::Countdown::stop | ( | ) | -> bool |
Stop countdown and check.
Definition at line 78 of file countdown.cpp.
Referenced by updateTimeLeft().
Here is the caller graph for this function:
|
signal |
Update countdown.
Referenced by FotoBox::FotoBox::countdown(), FotoBox::Preferences::Preferences(), and updateTimeLeft().
Here is the caller graph for this function:
|
private |
Start the timer until there is no time left, means.
Attention: this function always deals with the already expired second.
Definition at line 25 of file countdown.cpp.
References elapsed(), m_timeLeft, stop(), and update().
Referenced by Countdown().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
|
private |
countdown start time (seconds)
Definition at line 112 of file countdown.h.
Referenced by setStartTime().
|
private |
|
private |
|
staticconstexprprivate |