2011-02-27 09:11:01 +00:00
|
|
|
bool pCheckBox::checked() {
|
|
|
|
return qtCheckBox->isChecked();
|
|
|
|
}
|
|
|
|
|
2011-04-30 13:12:15 +00:00
|
|
|
Geometry pCheckBox::minimumGeometry() {
|
|
|
|
Font &font = this->font();
|
|
|
|
Geometry geometry = font.geometry(checkBox.state.text);
|
|
|
|
return { 0, 0, geometry.width + 26, geometry.height + 6 };
|
|
|
|
}
|
|
|
|
|
2011-02-27 09:11:01 +00:00
|
|
|
void pCheckBox::setChecked(bool checked) {
|
|
|
|
locked = true;
|
|
|
|
qtCheckBox->setChecked(checked);
|
|
|
|
locked = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void pCheckBox::setText(const string &text) {
|
|
|
|
qtCheckBox->setText(QString::fromUtf8(text));
|
|
|
|
}
|
|
|
|
|
|
|
|
void pCheckBox::constructor() {
|
|
|
|
qtWidget = qtCheckBox = new QCheckBox;
|
|
|
|
connect(qtCheckBox, SIGNAL(stateChanged(int)), SLOT(onTick()));
|
|
|
|
}
|
|
|
|
|
|
|
|
void pCheckBox::onTick() {
|
|
|
|
if(locked == false && checkBox.onTick) checkBox.onTick();
|
|
|
|
}
|