summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2012-06-18 17:26:30 +0300
committerQt by Nokia <qt-info@nokia.com>2012-07-03 14:50:34 +0200
commit8368557b9c0010fb205969d010c9d8549fbee0ae (patch)
treeaa6a572b368c8084554ac84097925779346b433d /tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
parent6b5bbc531b30d8ece25425e39843c6ae1af1d045 (diff)
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>
Diffstat (limited to 'tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp')
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
index 7a5aabe714..27ad4ff899 100644
--- a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -1771,9 +1771,7 @@ void tst_QGraphicsWidget::updateFocusChainWhenChildDie()
QGraphicsScene scene;
QGraphicsView view(&scene);
view.show();
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(&view);
-#endif
+ QTest::qWaitForWindowExposed(view.windowHandle());
QApplication::setActiveWindow(&view);
QTRY_COMPARE(QApplication::activeWindow(), (QWidget*)&view);
@@ -1802,9 +1800,6 @@ void tst_QGraphicsWidget::updateFocusChainWhenChildDie()
QVERIFY(w);
QTest::mouseMove(view.viewport());
QTest::mouseClick(view.viewport(), Qt::LeftButton, 0);
-#ifdef Q_OS_MAC
- QEXPECT_FAIL("", "QTBUG-23699", Continue);
-#endif
QTRY_COMPARE(qApp->activeWindow(), static_cast<QWidget *>(&view));
QTRY_COMPARE(scene.focusItem(), static_cast<QGraphicsItem *>(w));
}