diff options
Diffstat (limited to 'src/widgets/widgets/qgroupbox.cpp')
-rw-r--r-- | src/widgets/widgets/qgroupbox.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/widgets/widgets/qgroupbox.cpp b/src/widgets/widgets/qgroupbox.cpp index 0ff5dc8753..559c8bbd33 100644 --- a/src/widgets/widgets/qgroupbox.cpp +++ b/src/widgets/widgets/qgroupbox.cpp @@ -653,9 +653,7 @@ void QGroupBox::setChecked(bool b) void QGroupBoxPrivate::_q_setChildrenEnabled(bool b) { Q_Q(QGroupBox); - QObjectList childList = q->children(); - for (int i = 0; i < childList.size(); ++i) { - QObject *o = childList.at(i); + for (QObject *o : q->children()) { if (o->isWidgetType()) { QWidget *w = static_cast<QWidget *>(o); if (b) { @@ -707,6 +705,8 @@ void QGroupBox::mousePressEvent(QMouseEvent *event) if (d->checkable && (d->pressedControl & (QStyle::SC_GroupBoxCheckBox | QStyle::SC_GroupBoxLabel))) { d->overCheckBox = true; update(style()->subControlRect(QStyle::CC_GroupBox, &box, QStyle::SC_GroupBoxCheckBox, this)); + } else { + event->ignore(); } } @@ -723,6 +723,8 @@ void QGroupBox::mouseMoveEvent(QMouseEvent *event) if (d->checkable && (d->pressedControl == QStyle::SC_GroupBoxCheckBox || d->pressedControl == QStyle::SC_GroupBoxLabel) && (d->overCheckBox != oldOverCheckBox)) update(style()->subControlRect(QStyle::CC_GroupBox, &box, QStyle::SC_GroupBoxCheckBox, this)); + + event->ignore(); } /*! \reimp */ |