summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qgroupbox.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-10-14 01:00:34 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-10-14 01:00:34 +0200
commite164d61ca8263fc4b46fdd916e1ea77c7dd2b735 (patch)
tree06c50077b8baf41b756dc1aa8021c4a9ca34a9d4 /src/widgets/widgets/qgroupbox.cpp
parent721a0e807881e4d00e752e3c3cf62427eb681dd2 (diff)
parent8d8140dffa9aa680a519b501fc5bdf08c91dd735 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'src/widgets/widgets/qgroupbox.cpp')
-rw-r--r--src/widgets/widgets/qgroupbox.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/widgets/widgets/qgroupbox.cpp b/src/widgets/widgets/qgroupbox.cpp
index 69eac1ebf7..eec794562a 100644
--- a/src/widgets/widgets/qgroupbox.cpp
+++ b/src/widgets/widgets/qgroupbox.cpp
@@ -389,9 +389,13 @@ bool QGroupBox::event(QEvent *e)
void QGroupBox::childEvent(QChildEvent *c)
{
Q_D(QGroupBox);
- if (c->type() != QEvent::ChildAdded || !c->child()->isWidgetType())
+ /*
+ Children might have been enabled after being added to the group box, in which case
+ the childEvent handler ran too early, and we need to disabled children again.
+ */
+ if (!(c->added() || c->polished()) || !c->child()->isWidgetType())
return;
- QWidget *w = (QWidget*)c->child();
+ QWidget *w = static_cast<QWidget*>(c->child());
if (w->isWindow())
return;
if (d->checkable) {