Allow clicking on labels of collapse group boxes to toggle

This commit is contained in:
baldurk
2018-06-13 09:17:03 +01:00
parent 9b33a73631
commit d9bab79dbc
2 changed files with 13 additions and 7 deletions
+4 -2
View File
@@ -130,7 +130,9 @@ void CollapseGroupBox::mouseReleaseEvent(QMouseEvent *event)
// pretend we have a groupbox so we can hit-test for it
option.subControls |= QStyle::SC_GroupBoxCheckBox;
if(style()->hitTestComplexControl(QStyle::CC_GroupBox, &option, event->pos(), this) ==
QStyle::SC_GroupBoxCheckBox)
if(style()->hitTestComplexControl(QStyle::CC_GroupBox, &option, event->pos(), this) &
(QStyle::SC_GroupBoxCheckBox | QStyle::SC_GroupBoxLabel))
{
setCollapsed(!m_collapsed);
}
}