qt5base-lts/tests/auto
Richard Moe Gustavsen 0dbede2b17 Widgets: be able to tab to a widget that has a focus proxy
When tabbing/searching for the next focus widget, the current
code would check if the next widget in the focus chain
had a focus proxy, and if so, ignore it. The exact reason
for this behavior is not clearly understood, but some widgets
(e.g QSpinBox) has children (a QLineEdit) that sets the parent
as focus proxy. If we didn't ignore children with focus proxy, tabbing
from a QSpinBox would lead us to find the inner QLineEdit, which
(because of its proxy), would lead us back to the QSpinBox. And
therefore not be able to tab out.

But ignoring the focus proxy has other problems. Normally a focus
proxy is the next sibling to the widget it acts as a proxy for, and
tabbing to the widget will therefore appear correct. But if the
focus proxy is not the next sibling, the logic will fail, since
the tab would anyway give focus to the next sibling. This becomes very
apparent if the focus proxy is a child of the widget, since then
its likely that the focus proxy is not the _first_ child among all
the children. So tabbing to the parent would not give focus to
the proxy.

This patch will change this logic so that you are allowed to tab to a
widget with a focus proxy. But we check that if you do so, you actually
end up moving focus in the right direction. If not, we ignore it like
before. This will ensure that we tab correctly when dealing with focus
proxies, and especially when focus proxies are used to construct
compound widgets.

[ChangeLog][Widgets] When tabbing to a widget with focus proxy, focus
will now be given to the proxy rather than just being ignored.

Task-number: QTBUG-10907
Change-Id: I66d1da5c941fdd984bb2783cc355ca65b553b5dd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-09-25 07:18:37 +00:00
..
android
bic/data Update binary compatibility files for Qt 5.9.0 for QtBase 2017-08-14 13:48:17 +00:00
cmake tests: Unify license to GPL-EXCEPT 2017-04-03 07:18:46 +00:00
compilerwarnings/data
concurrent Merge remote-tracking branch 'origin/5.9' into dev 2017-08-02 22:52:32 +02:00
corelib QRandomGenerator: update API to better name 2017-09-22 15:29:42 +00:00
dbus Use QSharedPointer::create() more 2017-07-19 13:40:42 +00:00
gui Merge remote-tracking branch 'origin/5.9' into 5.10 2017-09-20 11:58:32 +02:00
guiapplauncher
installed_cmake
network Autotest: centralize the detection of IPv6 support 2017-09-25 05:38:27 +00:00
opengl tst_QGL::graphicsViewClipping: Wait for viewport's window handle 2017-07-17 14:11:06 +00:00
other Merge remote-tracking branch 'origin/5.9' into dev 2017-08-08 11:48:10 +02:00
printsupport Convert features.completer to QT_[REQUIRE_]CONFIG 2017-09-04 11:28:02 +00:00
shared Remove workaround for potentially unavailable pasteboard in macOS 2017-03-07 01:04:46 +00:00
sql Merge remote-tracking branch 'origin/5.9' into 5.10 2017-09-20 11:58:32 +02:00
testlib Testlib: Format QVector2/3/4D in QCOMPARE 2017-08-27 06:17:32 +00:00
tools Merge remote-tracking branch 'origin/5.9' into dev 2017-08-31 14:31:31 +02:00
widgets Widgets: be able to tab to a widget that has a focus proxy 2017-09-25 07:18:37 +00:00
xml Merge remote-tracking branch 'origin/5.7' into 5.8 2016-11-01 06:02:55 +01:00
auto.pro Remove remains of wince in .pro files 2017-07-03 05:32:51 +00:00
network-settings.h