qt6-bb10/tests/auto/widgets/kernel
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
..
qaction tst_QAction::disableShortcutsWithBlockedWidgets remove setActiveWindow 2024-04-30 18:30:16 +02:00
qactiongroup Change license for tests files 2024-02-04 09:56:42 +01:00
qapplication ColorScheme: make QStyleHints::colorScheme writable for applications 2024-05-10 01:15:12 +02:00
qboxlayout Remove extra semi-colons 2024-02-06 20:17:18 +09:00
qformlayout Change license for tests files 2024-02-04 09:56:42 +01:00
qgesturerecognizer Change license for tests files 2024-02-04 09:56:42 +01:00
qgridlayout Change license for tests files 2024-02-04 09:56:42 +01:00
qlayout QLayout: Consume ChildRemoved event, when layout is disabled 2024-04-10 19:01:06 +00:00
qshortcut tst_QShortcut::duplicatedShortcutOverride() remove setActiveWindow() 2024-04-26 17:37:57 +02:00
qsizepolicy Change license for tests files 2024-02-04 09:56:42 +01:00
qstackedlayout tst_QStackedLayout::keepFocusAfterSetCurrent() remove setActiveWindow() 2024-05-06 16:29:02 +02:00
qtooltip tst_QTooltip::qtbug64550_stylesheet() remove setActiveWindow() 2024-04-26 18:19:37 +02:00
qwidget Widgets focus abstraction: Fix re-parenting 2024-05-23 01:12:32 +02:00
qwidget_window tst_QWidget_window::tst_dnd() remove setActiveWindow() 2024-04-26 18:19:37 +02:00
qwidgetaction Change license for tests files 2024-02-04 09:56:42 +01:00
qwidgetmetatype Change license for tests files 2024-02-04 09:56:42 +01:00
qwidgetrepaintmanager Decouple rate-limiting of paint-on-screen widgets from top level widget 2024-04-04 01:26:56 +02:00
qwidgetsvariant Change license for tests files 2024-02-04 09:56:42 +01:00
qwindowcontainer Set focus to the window container when contained window gains focus 2024-04-22 16:01:01 +02:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00