From 3cb3a2511cef94d201f7f3813bba995a9b4d856b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Lefebvre?= Date: Fri, 2 Feb 2024 10:45:57 +0100 Subject: [PATCH] tst_QAbstractView::inputMethodEnabled() remove setActiveWindow() 2f6fe3a26843ff68c5d3f9af0a2fc3cce6caac22 has made calls to QApplicationPrivate::setActiveWindow() redundant. Remove 6 redundant calls from the //Check focus by switching the activation of the window to force a focus in section. Task-number: QTBUG-121488 Change-Id: I9f1ff1680ae01253261717ee81920ec38dfe8847 Reviewed-by: Axel Spoerl --- .../itemviews/qabstractitemview/tst_qabstractitemview.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp index 53816226bc..6aaf7c75ef 100644 --- a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp +++ b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp @@ -2457,15 +2457,11 @@ void tst_QAbstractItemView::inputMethodEnabled() // Check focus by switching the activation of the window to force a focus in view->setCurrentIndex(model->index(1, 0)); - QApplicationPrivate::setActiveWindow(nullptr); - QApplicationPrivate::setActiveWindow(view.data()); QVERIFY(QTest::qWaitForWindowActive(view.data())); QCOMPARE(view->testAttribute(Qt::WA_InputMethodEnabled), result); view->setCurrentIndex(QModelIndex()); QVERIFY(!view->testAttribute(Qt::WA_InputMethodEnabled)); - QApplicationPrivate::setActiveWindow(nullptr); - QApplicationPrivate::setActiveWindow(view.data()); QVERIFY(QTest::qWaitForWindowActive(view.data())); QModelIndex index = model->index(1, 0); QPoint p = view->visualRect(index).center(); @@ -2475,8 +2471,6 @@ void tst_QAbstractItemView::inputMethodEnabled() QCOMPARE(view->testAttribute(Qt::WA_InputMethodEnabled), result); index = model->index(0, 0); - QApplicationPrivate::setActiveWindow(nullptr); - QApplicationPrivate::setActiveWindow(view.data()); QVERIFY(QTest::qWaitForWindowActive(view.data())); p = view->visualRect(index).center(); QTest::mouseClick(view->viewport(), Qt::LeftButton, Qt::NoModifier, p);