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 <axel.spoerl@qt.io>
This commit is contained in:
Volker Hilsheimer 2025-06-13 15:30:50 +02:00
parent ab53b12931
commit 9f93ddd2f3

View File

@ -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)