1 #ifndef BOXINGSETTINGS_H 2 #define BOXINGSETTINGS_H 24 Q_PROPERTY(QString presetName READ
getPresetName NOTIFY presetChanged)
34 const int DefaultRounds = 12;
40 const int DefaultRoundMilliseconds = 3 * 60 * 1000;
45 const int DefaultRestMilliseconds = 60 * 1000;
51 const QString DefaultPreset =
"";
57 const QString DefaultPresetName =
"Default";
81 Q_INVOKABLE
void savePreset(
const QString &name,
const int &rounds,
const int &roundMilliseconds,
const int &restMilliseconds);
95 BoxingSettings(
const int &rounds,
const int &roundMilliseconds,
const int &restMilliseconds);
138 inline void setRounds(
const int &rounds) { mRounds = rounds; }
166 int mRoundMilliseconds;
167 int mRestMilliseconds;
184 void setDefaultPreset();
192 inline const QString convertRichNameToGroup(
const QString &richName) {
return richName.toLower().simplified().replace(
" ",
""); }
198 #endif // BOXINGSETTINGS_H void setRestMilliseconds(const int &restMilliseconds)
Setter for milliseconds of rest.
Definition: boxingsettings.h:154
void setPreset(const QString &preset)
Setter for preset.
Definition: boxingsettings.cpp:25
QString getPreset()
Definition: boxingsettings.h:123
Q_INVOKABLE const QStringList presetsList()
Definition: boxingsettings.cpp:84
void setRounds(const int &rounds)
Setter for number of rounds.
Definition: boxingsettings.h:138
Q_INVOKABLE void savePreset(const QString &name, const int &rounds, const int &roundMilliseconds, const int &restMilliseconds)
Save or override settings about specific preset.
Definition: boxingsettings.cpp:59
int getRestMilliseconds()
Definition: boxingsettings.h:116
int getRoundMilliseconds()
Definition: boxingsettings.h:109
Q_INVOKABLE void deletePreset(const QString &name)
Delete a specified preset.
Definition: boxingsettings.cpp:72
QString getPresetName()
Definition: boxingsettings.h:130
BoxingSettings()
Definition: boxingsettings.cpp:5
int getRounds()
Definition: boxingsettings.h:102
Handle settings about timer. Can save, load and delete a specific preset.
Definition: boxingsettings.h:19
void setRoundMilliseconds(const int &roundMilliseconds)
Setter for duration of round (in milliseconds)
Definition: boxingsettings.h:146