1 From 947883141d9d8b3079a8a21981ad8a5ce3c4798e Mon Sep 17 00:00:00 2001
2 From: David Faure <david.faure@kdab.com>
3 Date: Mon, 9 Sep 2019 18:12:26 +0200
4 Subject: [PATCH] QWidget::setFocusProxy: adjust focus widget properly
6 My commit 3e7463411e adjusted the focus widget by setting
7 QApplicationPrivate::focus_widget directly, while there is a method for
8 doing this properly, including setFocus_sys() and emitting signals.
11 Change-Id: I218acf7a9de39173d282ced46def4f65594f80b4
12 Reviewed-by: Florian Bruhin <qt-project.org@the-compiler.org>
13 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
14 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
15 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
17 src/widgets/kernel/qwidget.cpp | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
20 diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
21 index 04290a4ce12..0fa59077449 100644
22 --- a/src/widgets/kernel/qwidget.cpp
23 +++ b/src/widgets/kernel/qwidget.cpp
24 @@ -6446,7 +6446,7 @@ void QWidget::setFocusProxy(QWidget * w)
26 if (changingAppFocusWidget) {
27 QWidget *newDeepestFocusProxy = d_func()->deepestFocusProxy();
28 - QApplicationPrivate::focus_widget = newDeepestFocusProxy ? newDeepestFocusProxy : this;
29 + QApplicationPrivate::setFocusWidget(newDeepestFocusProxy ? newDeepestFocusProxy : this, Qt::NoFocusReason);