If click on buddy label of check or radio, then toggle

This commit is contained in:
craig.p.drummond
2014-03-03 19:35:37 +00:00
committed by craig.p.drummond
parent dc6084c2b1
commit 3bb4d3bd5e
2 changed files with 11 additions and 10 deletions

View File

@@ -48,6 +48,7 @@
characters in artist names with the relevant URL encoding.
6. Use CMake to locate X11 libraries and headers.
7. Set minimum size for initial settings wizard.
8. If buddy of a checkbox or radio is clicked, then toggle check or radio.
1.3.1
-----

View File

@@ -70,16 +70,16 @@ void BuddyLabel::mouseReleaseEvent(QMouseEvent *)
buddy()->setFocus();
// QCheckBox *cb=qobject_cast<QCheckBox*>(buddy());
// if (cb) {
// cb->setChecked(!cb->isChecked());
// return;
// }
// QRadioButton *rb=qobject_cast<QRadioButton*>(buddy());
// if (rb) {
// rb->setChecked(!rb->isChecked());
// return;
// }
QCheckBox *cb=qobject_cast<QCheckBox*>(buddy());
if (cb) {
cb->setChecked(!cb->isChecked());
return;
}
QRadioButton *rb=qobject_cast<QRadioButton*>(buddy());
if (rb) {
rb->setChecked(!rb->isChecked());
return;
}
QComboBox *combo=qobject_cast<QComboBox*>(buddy());
if (combo) {
combo->showPopup();