-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.1, 5.5.0
-
None
-
4ac94480c33caa8c95254fc9db3352a832f55b7e
QGroupBox does not propagate left mouse button press events to its parent. The following patch would fix this for non-checkable groupboxes and provide a small performance improvement at the same time.
--- qgroupbox.cpp.orig 2010-11-22 16:49:33.786298601 +0100
+++ qgroupbox.cpp 2010-11-22 16:50:18.514298602 +0100
@@ -693,7 +693,7 @@
/*! \reimp */
void QGroupBox::mousePressEvent(QMouseEvent *event)
{
- if (event->button() != Qt::LeftButton) {
+ if (event->button() != Qt::LeftButton || !d->checkable) {
event->ignore();
return;
}
@@ -703,7 +703,7 @@
initStyleOption(&box);
d->pressedControl = style()->hitTestComplexControl(QStyle::CC_GroupBox, &box,
event->pos(), this);
- if (d->checkable && (d->pressedControl & (QStyle::SC_GroupBoxCheckBox | QStyle::SC_GroupBoxLabel))) {
+ if (d->pressedControl & (QStyle::SC_GroupBoxCheckBox | QStyle::SC_GroupBoxLabel)) {
d->overCheckBox = true;
update(style()->subControlRect(QStyle::CC_GroupBox, &box, QStyle::SC_GroupBoxCheckBox, this));
}
| For Gerrit Dashboard: QTBUG-15519 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 124009,3 | QGroupBox: Send unhandled mouse events to parent widget | dev | qt/qtbase | Status: MERGED | +2 | 0 |