2018-05-23 06:11:58 +00:00
|
|
|
#include "CheckableItem.h"
|
|
|
|
|
2019-10-05 14:14:45 +00:00
|
|
|
CheckableItem::CheckableItem(const std::string& text)
|
|
|
|
: m_text(text)
|
2018-05-23 06:11:58 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string CheckableItem::getText() const
|
|
|
|
{
|
2019-10-05 14:14:45 +00:00
|
|
|
return m_text;
|
2018-05-23 06:11:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool CheckableItem::isChecked() const
|
|
|
|
{
|
2019-10-05 14:14:45 +00:00
|
|
|
return m_checked;
|
2018-05-23 06:11:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CheckableItem::setState(bool checked)
|
|
|
|
{
|
2019-10-05 14:14:45 +00:00
|
|
|
m_checked = checked;
|
2018-05-23 06:11:58 +00:00
|
|
|
}
|
2018-05-23 09:08:50 +00:00
|
|
|
|
2018-06-29 17:31:28 +00:00
|
|
|
unsigned int CheckableItem::value() const
|
|
|
|
{
|
2019-10-05 14:14:45 +00:00
|
|
|
return m_value;
|
2018-06-29 17:31:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CheckableItem::setValue(unsigned int value)
|
|
|
|
{
|
2019-10-05 14:14:45 +00:00
|
|
|
m_value = value;
|
2018-06-29 17:31:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned int CheckableItem::points() const
|
|
|
|
{
|
2019-10-05 14:14:45 +00:00
|
|
|
return m_checked ? m_value : 0;
|
2018-06-29 17:31:28 +00:00
|
|
|
}
|