2011-02-27 09:05:10 +00:00
|
|
|
bool pCheckItem::checked() {
|
|
|
|
return qtAction->isChecked();
|
|
|
|
}
|
|
|
|
|
|
|
|
void pCheckItem::setChecked(bool checked) {
|
|
|
|
qtAction->setChecked(checked);
|
|
|
|
}
|
|
|
|
|
|
|
|
void pCheckItem::setText(const string &text) {
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2011-12-12 10:59:53 +00:00
|
|
|
void pCheckItem::onToggle() {
|
2011-02-27 09:05:10 +00:00
|
|
|
checkItem.state.checked = checked();
|
2011-12-12 10:59:53 +00:00
|
|
|
if(checkItem.onToggle) checkItem.onToggle();
|
2011-02-27 09:05:10 +00:00
|
|
|
}
|