summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qapplication.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-09-26 16:08:55 +0200
committerLiang Qi <liang.qi@qt.io>2017-09-26 16:14:54 +0200
commitaadfe7d634de04519102c5827ca885dc2e2199c9 (patch)
treed92db346ca95332b177036a53f1f6beb2e24fb74 /src/widgets/kernel/qapplication.cpp
parent4b6c1448047362b8c38d265e6414f0e3e59b8d37 (diff)
parenta732e16d5fd9dbf8a0289fec9f948b12e9ba2c19 (diff)
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts: src/gui/kernel/qguiapplication.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h src/plugins/platforms/cocoa/qcocoawindow.h src/testlib/qtestsystem.h Change-Id: I5975ffb3261c2dd82fe02ec4e57df7c0950226c5
Diffstat (limited to 'src/widgets/kernel/qapplication.cpp')
-rw-r--r--src/widgets/kernel/qapplication.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index d141abce24..93e2db4b1a 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -2228,8 +2228,15 @@ QWidget *QApplicationPrivate::focusNextPrevChild_helper(QWidget *toplevel, bool
if (test->isWindow())
seenWindow = true;
+ // If the next focus widget has a focus proxy, we need to check to ensure
+ // that the proxy is in the correct parent-child direction (according to
+ // \a next). This is to ensure that we can tab in and out of compound widgets
+ // without getting stuck in a tab-loop between parent and child.
+ QWidget *focusProxy = test->d_func()->deepestFocusProxy();
+
if ((test->focusPolicy() & focus_flag) == focus_flag
- && !(test->d_func()->extra && test->d_func()->extra->focus_proxy)
+ && !(next && focusProxy && focusProxy->isAncestorOf(test))
+ && !(!next && focusProxy && test->isAncestorOf(focusProxy))
&& test->isVisibleTo(toplevel) && test->isEnabled()
&& !(w->windowType() == Qt::SubWindow && !w->isAncestorOf(test))
&& (toplevel->windowType() != Qt::SubWindow || toplevel->isAncestorOf(test))) {