diff options
| author | Axel Spoerl <axel.spoerl@qt.io> | 2024-05-10 21:04:57 +0200 |
|---|---|---|
| committer | Axel Spoerl <axel.spoerl@qt.io> | 2024-05-23 01:12:32 +0200 |
| commit | 2d4993899f0dfda1288e891bc4d9a890af851a4f (patch) | |
| tree | 02f4ca2d6fb4fdb29f8e76b70c9a67096bd0b449 /src/network/kernel/qnetworkinterface_unix.cpp | |
| parent | 709e9d90ab9f7ec962d23d83467a06532f5f771b (diff) | |
Widgets focus abstraction: Fix re-parenting
Focus abstraction in 58d5d4b7c2faaeaa2c2ccdabb3da6d37f9db880a was
supposed to be behavior-neutral. QWidgetPrivate::reparentFocusChildren
used QObject::findChildren() to find children inside and outside the
current focus chain. If the re-parented widget had only direct children
and the focus chain was equal to creation-order, the result was
identical to previous behavior.
When the re-parented widget had grandchildren, the behavior differred.
While not being detected by existing tests, it caused a regression.
Re-implement the previous logic: Iterate through the focus chain,
instead of relying on QObject::findChildren() returning a complete and
well-ordered list.
Modify tst_QWidget::focusChainOnReparent() in order to cover the
regression.
This amends 58d5d4b7c2faaeaa2c2ccdabb3da6d37f9db880a.
Fixes: QTBUG-125257
Change-Id: Iff4f1d0d9b6117c50c8980dfb6eebfc6f6d4a710
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/network/kernel/qnetworkinterface_unix.cpp')
0 files changed, 0 insertions, 0 deletions
