From bb42b7d8b2fe8508074bc4574679893c6cf4fbd5 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 6 Jan 2020 10:26:49 +0100 Subject: Make sure the focus is passed on correctly when back-tabbing When the tested widget has a focus proxy, then we should check if the current focus widget is not the same as that focus proxy before setting it to be the widget that gets focus. This ensures that when back-tabbing from a widget like QDoubleSpinBox that it will not get stuck inside that widget and will back-tab to the next correct one. Fixes: QTBUG-81097 Change-Id: I3f689c7715da7f3ce8c3d2f616041528f5778a2f Reviewed-by: Friedemann Kleint --- src/widgets/kernel/qapplication.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/widgets/kernel/qapplication.cpp') diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index ef76265f8b..ce32fd39a8 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -2139,7 +2139,8 @@ QWidget *QApplicationPrivate::focusNextPrevChild_helper(QWidget *toplevel, bool && !(!next && focusProxy && test->isAncestorOf(focusProxy)) && test->isVisibleTo(toplevel) && test->isEnabled() && !(w->windowType() == Qt::SubWindow && !w->isAncestorOf(test)) - && (toplevel->windowType() != Qt::SubWindow || toplevel->isAncestorOf(test))) { + && (toplevel->windowType() != Qt::SubWindow || toplevel->isAncestorOf(test)) + && f != focusProxy) { w = test; if (seenWindow) focusWidgetAfterWindow = true; -- cgit v1.2.3