From 9f93ddd2f3ce77a6d4ccd2de93bff95244d381d8 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Fri, 13 Jun 2025 15:30:50 +0200 Subject: [PATCH] QGroupBox: document non-standard behavior for enable/disable logic When QGroupBox::checked changes, it disables children, and enables children that are not explicitly disabled. The group box itself however remains enabled, so it's possible for user code to override the behavior for individual child widgets, which can happen accidentally when the order in which children are added, and the checked state of the group box is changed, is inconsistent. We won't change this as it has too many side effects. Instead, document the conceptually deviation from enable/disable state propagation. Pick-to: 6.10 6.9 6.8 6.5 Fixes: QTBUG-25938 Change-Id: I2aa37600ec932cd4ce721bfa98f63169eb0d0beb Reviewed-by: Axel Spoerl --- src/widgets/widgets/qgroupbox.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/widgets/widgets/qgroupbox.cpp b/src/widgets/widgets/qgroupbox.cpp index 991dc028c83..a56044c9cc6 100644 --- a/src/widgets/widgets/qgroupbox.cpp +++ b/src/widgets/widgets/qgroupbox.cpp @@ -596,6 +596,11 @@ bool QGroupBox::isChecked() const By default, checkable group boxes are also checked. + \note The group box itself will not be disabled when the box is unchecked, + and you can explicitly enable individual children in a group box that is + unchecked. This is however not recommended, as it could create a surprising + experience for the end user. + \sa checkable */ void QGroupBox::setChecked(bool b)