qt5base-lts/tests/auto/widgets
Andreas Aardal Hanssen d6f2d8dcb6 Make sure panels always gain focus when activated or tab is pressed.
This changes behavior, but I would argue it's a good change. If you
create a panel and activate it (e.g., by simply showing it or reparenting
it onto an already-visible item), you expect the panel to gain focus /
which is sort of the whole point of activating it. Prior to this change,
you had to have explicitly called setFocus() on one of the panel's
children, which would give that item subfocus, for that item to auto-
gain focus when the panel was activated. This change makes it more
automatic. If the panel itself or any of the widgets in its focus chain
can gain focus, they will gain focus when the panel is activated.

So the new logic is - if the panel already has a focus item, so if
someone explicitly set subfocus on an item before the panel is shown,
that item gets focus. Otherwise, if the panel itself can gain focus
(e.g., someone makes a line edit / text edit panel), it gains focus
when activated. Otherwise, we search the focus chain until we find
the first item that can gain focus. This last case is the file dialog
case, where the dialog itself can't gain focus but typically the
first item in the focus chain is the primary focus widget, such as
the search field or the directory list view.

The change also fixes this for the first Tab. If you clear focus on
a panel, the user expects to be able to press Tab to regain focus.
Prior to this change that didn't happen. Now, the panel or the first
in the focus chain that can get focus gets focus on first tab.

Task-number: QTBUG-28194
Change-Id: Id7ec1741d0d5eb4ea845469909c8d684e14017f1
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2012-12-17 08:58:04 +01:00
..
dialogs Made QMacStyle internal 2012-11-23 15:18:15 +01:00
effects Make QPen default to 1-width non-cosmetic. 2012-10-22 19:36:43 +02:00
graphicsview Make sure panels always gain focus when activated or tab is pressed. 2012-12-17 08:58:04 +01:00
itemviews tst_qlistview: remove redundant include 2012-11-23 15:15:27 +01:00
kernel [QTBUG-27420] Make Q{Box,Grid,Form}Layout::takeAt() unparent a nested layout 2012-12-02 00:23:14 +01:00
styles Style auto tests: kill QWindowsStyle dependencies 2012-11-28 20:54:39 +01:00
util normalise signal/slot signatures [QtWidgets tests] 2012-10-19 00:44:54 +02:00
widgets tst_QDialogButtonBox: fix typos 2012-12-13 10:19:20 +01:00
widgets.pro Moved tests into integrationtests/ and widgets/ 2011-10-20 19:45:41 +02:00