Fix focus handling when the application has QAxWidgets.
authorMiikka Heikkinen <miikka.heikkinen@digia.com>
Mon, 18 Jun 2012 14:26:30 +0000 (17:26 +0300)
committerQt by Nokia <qt-info@nokia.com>
Tue, 3 Jul 2012 12:50:34 +0000 (14:50 +0200)
commit8368557b9c0010fb205969d010c9d8549fbee0ae
treeaa6a572b368c8084554ac84097925779346b433d
parent6b5bbc531b30d8ece25425e39843c6ae1af1d045
Fix focus handling when the application has QAxWidgets.

Removed old defunct platform specific code from
QWidget::isActiveWindow() and added call to
QPlatformWindow::isActive() instead. This is done because
the embedded native windows inside QAxWidgets can have
focus but are not part of the parent application's Qt
window hierarchy, so native methods are required to determine
if they are part of the active window or not.

QWidgetPrivate::setFocus_sys() was implemented to activate
the window of the focused widget if the focus was elsewhere.
This is required because embedded native windows can steal the
focus from the main application window.

Focus event handling in Windows platform adaptation plugin was
fixed to correctly identify the active window in cases where
the are embedded native widgets that can have focus.

Also fixed three test cases that were affected by these changes.

Task-number: QTBUG-25852
Task-number: QTBUG-23699
Change-Id: I817e0ce4317e88955bb49b034eacd630a876ccf0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
src/plugins/platforms/windows/qwindowscontext.cpp
src/plugins/platforms/windows/qwindowscontext.h
src/widgets/kernel/qwidget.cpp
src/widgets/kernel/qwidget_qpa.cpp
tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp