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