2018-05-23 06:11:58 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-05-23 09:08:50 +00:00
|
|
|
#include <QJsonObject>
|
|
|
|
|
2018-05-23 06:11:58 +00:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
class CheckableItem
|
|
|
|
{
|
|
|
|
private:
|
2018-05-23 15:47:04 +00:00
|
|
|
bool m_checked = false;
|
|
|
|
std::string m_text;
|
2018-06-29 17:31:28 +00:00
|
|
|
unsigned int m_value = 1;
|
2018-05-23 06:11:58 +00:00
|
|
|
|
|
|
|
public:
|
2018-05-23 15:47:04 +00:00
|
|
|
CheckableItem() = default;
|
|
|
|
CheckableItem(const std::string &text);
|
2018-05-23 06:11:58 +00:00
|
|
|
|
2018-05-23 15:47:04 +00:00
|
|
|
std::string getText() const;
|
2018-06-29 17:31:28 +00:00
|
|
|
|
2018-05-23 15:47:04 +00:00
|
|
|
bool isChecked() const;
|
|
|
|
void setState(bool checked);
|
2018-05-23 09:08:50 +00:00
|
|
|
|
2018-06-29 17:31:28 +00:00
|
|
|
unsigned int value() const;
|
|
|
|
void setValue(unsigned int value);
|
|
|
|
|
|
|
|
unsigned int points() const;
|
2018-05-23 06:11:58 +00:00
|
|
|
};
|