2018-05-23 06:11:58 +00:00
|
|
|
#include "CheckableItem.h"
|
|
|
|
|
|
|
|
CheckableItem::CheckableItem(const std::string &text)
|
2018-05-23 15:47:04 +00:00
|
|
|
: m_text(text)
|
2018-05-23 06:11:58 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string CheckableItem::getText() const
|
|
|
|
{
|
2018-05-23 15:47:04 +00:00
|
|
|
return m_text;
|
2018-05-23 06:11:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool CheckableItem::isChecked() const
|
|
|
|
{
|
2018-05-23 15:47:04 +00:00
|
|
|
return m_checked;
|
2018-05-23 06:11:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CheckableItem::setState(bool checked)
|
|
|
|
{
|
2018-05-23 15:47:04 +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
|
|
|
|
{
|
|
|
|
return m_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CheckableItem::setValue(unsigned int value)
|
|
|
|
{
|
|
|
|
m_value = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned int CheckableItem::points() const
|
|
|
|
{
|
|
|
|
return m_checked ? m_value : 0;
|
|
|
|
}
|