qt5base-lts/tests/auto/widgets/kernel
Volker Hilsheimer 46648436d4 Fix focus chain with compound widgets if created out of order
When a compound widget is created not directly before its children,
then another widget will be in the focus chain between the compound and
the compound's first child. If one of those children is then made the
focus proxy of the compound, then the widget in between becomes
unreachable by tabbing.

To fix this, detect that we set the focus proxy to be a descendent of
the compound widget, and then move the compound widget directly in front
of its first child in the focus chain. This way we can't have any gaps
in the focus chain.

Augment the test case with a corresponding scenario. As a drive-by, move
the debug helper up in the code so that it can be easier used, and set
object names on relevant widgets.

Pick-to: 6.4 6.2 5.15
Fixes: QTBUG-89156
Change-Id: I17057719a90f59629087afbd1d2ca58c1aa1d8f6
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-11-04 15:04:42 +02:00
..
qaction Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qactiongroup Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qapplication Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qboxlayout Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qformlayout Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qgesturerecognizer Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qgridlayout Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qlayout Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qshortcut Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qsizepolicy Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qstackedlayout Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qtooltip Deprecate QApplication::setActiveWindow() and mark as internal 2022-08-27 20:22:29 +02:00
qwidget Fix focus chain with compound widgets if created out of order 2022-11-04 15:04:42 +02:00
qwidget_window Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qwidgetaction Port from container.count()/length() to size() 2022-10-04 07:40:08 +02:00
qwidgetmetatype Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qwidgetrepaintmanager Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qwidgetsvariant Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qwindowcontainer Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
CMakeLists.txt Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00