qt5base-lts/tests
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
..
auto Make sure panels always gain focus when activated or tab is pressed. 2012-12-17 08:58:04 +01:00
baselineserver Qt5 updates to the QPainter lancelot autotest 2012-11-09 16:07:44 +01:00
benchmarks Examples: Install to $$[QT_INSTALL_EXAMPLES]/$submodule/$example 2012-11-26 14:35:23 +01:00
global Modularized tst_bic and add some helper functions for global test 2011-04-27 12:06:03 +02:00
manual Compile windowflags/windowgeometry manual tests against 4.8. 2012-12-03 12:00:18 +01:00
shared Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
README Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
tests.pro Properly implement a 'make docs' target for subdirs and apps/libs 2012-05-09 08:34:42 +02:00

This directory contains autotests and benchmarks based on QTestlib. In order
to run the autotests reliably, you need to configure a desktop to match the
test environment that these tests are written for.

Linux X11:

   * The user must be logged in to an active desktop; you can't run the
     autotests without a valid DISPLAY that allows X11 connections.

   * The tests are run against a KDE3 or KDE4 desktop.

   * Window manager uses "click to focus", and not "focus follows mouse". Many
     tests move the mouse cursor around and expect this to not affect focus
     and activation.

   * Disable "click to activate", i.e., when a window is opened, the window
     manager should automatically activate it (give it input focus) and not
     wait for the user to click the window.