From 9aff2fbd8606fc312931abd64fd934c665e1e75e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 15 Aug 2014 15:39:37 +0200 Subject: Send QWindow::focusObjectChanged when clearing widget focus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We do this for QWidget::setFocus(), but were missing a call on clearing the focus widget. Since QWidgetWindow::focusObject() will fall back to returning itself if there is no focus widget, we need to pass the result of window->focusObject() to the change signal instead of 0. Change-Id: I52a5519a19bb20e74b4a7c2a1abc9d47e2ea1315 Reviewed-by: Jan Arve Sæther --- src/widgets/kernel/qwidget.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/widgets') diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 57169edb9d..8ea43cfb6c 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -6569,6 +6569,11 @@ void QWidget::clearFocus() QAccessible::updateAccessibility(&event); #endif } + + if (QTLWExtra *extra = window()->d_func()->maybeTopData()) { + if (extra->window) + emit extra->window->focusObjectChanged(extra->window->focusObject()); + } } } -- cgit v1.2.3