qt6-bb10/tests/auto/widgets/kernel/qwidget
Axel Spoerl 2d4993899f Widgets focus abstraction: Fix re-parenting
Focus abstraction in 58d5d4b7c2 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 58d5d4b7c2.

Fixes: QTBUG-125257
Change-Id: Iff4f1d0d9b6117c50c8980dfb6eebfc6f6d4a710
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-05-23 01:12:32 +02:00
..
.gitignore
BLACKLIST Android: blacklist tst_QWidget::setParentChangesFocus 2024-04-12 20:12:18 +03:00
CMakeLists.txt CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
geometry-fullscreen.dat
geometry-maximized.dat
geometry.dat
hellotr_la.qm
tst_qwidget.cpp Widgets focus abstraction: Fix re-parenting 2024-05-23 01:12:32 +02:00