2013-03-15 13:11:33 +00:00
|
|
|
namespace phoenix {
|
|
|
|
|
2011-02-27 09:05:10 +00:00
|
|
|
void pCheckItem::setChecked(bool checked) {
|
|
|
|
qtAction->setChecked(checked);
|
|
|
|
}
|
|
|
|
|
2013-07-29 09:42:45 +00:00
|
|
|
void pCheckItem::setText(string text) {
|
2011-02-27 09:05:10 +00:00
|
|
|
qtAction->setText(QString::fromUtf8(text));
|
|
|
|
}
|
|
|
|
|
|
|
|
void pCheckItem::constructor() {
|
|
|
|
qtAction = new QAction(0);
|
|
|
|
qtAction->setCheckable(true);
|
2011-12-12 10:59:53 +00:00
|
|
|
connect(qtAction, SIGNAL(triggered()), SLOT(onToggle()));
|
2011-02-27 09:05:10 +00:00
|
|
|
}
|
|
|
|
|
2011-09-05 03:48:23 +00:00
|
|
|
void pCheckItem::destructor() {
|
|
|
|
if(action.state.menu) action.state.menu->remove(checkItem);
|
|
|
|
delete qtAction;
|
2013-05-02 11:25:45 +00:00
|
|
|
qtAction = nullptr;
|
2011-09-05 03:48:23 +00:00
|
|
|
}
|
|
|
|
|
2011-12-12 10:59:53 +00:00
|
|
|
void pCheckItem::onToggle() {
|
2013-11-28 10:29:01 +00:00
|
|
|
checkItem.state.checked = qtAction->isChecked();
|
2011-12-12 10:59:53 +00:00
|
|
|
if(checkItem.onToggle) checkItem.onToggle();
|
2011-02-27 09:05:10 +00:00
|
|
|
}
|
2013-03-15 13:11:33 +00:00
|
|
|
|
|
|
|
}
|