Allow clicking on labels of collapse group boxes to toggle

This commit is contained in:
baldurk committed 2018-06-13 09:17:03 +01:00
1 parent 9b33a73631
commit d9bab79dbc
2 files changed
+13 -7

No files matched your search

+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);
}
}