Only act on mouse-clicks if 'buddy' is enabled

This commit is contained in:
craig.p.drummond@gmail.com
2012-04-30 11:01:26 +00:00
parent 75949e2260
commit 77829d3229

View File

@@ -39,12 +39,13 @@ public:
protected:
void mouseReleaseEvent(QMouseEvent *) {
if (buddy()) {
if (buddy() && buddy()->isEnabled()) {
buddy()->setFocus();
}
QCheckBox *cb=qobject_cast<QCheckBox*>(buddy());
if (cb) {
cb->setChecked(!cb->isChecked());
QCheckBox *cb=qobject_cast<QCheckBox*>(buddy());
if (cb) {
cb->setChecked(!cb->isChecked());
}
}
}
};