From 2436e259ced39657f22176537603da44ff4e2512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 21 Apr 2022 20:43:33 +0200 Subject: Deprecate QApplication::setActiveWindow() and mark as internal The function is used the internal window activation machinery and should not be called by user code. Many tests still use this function, and should be ported over to QWidget::activateWindow(). For now they are using the private helper in QApplicationPrivate, so that we can progress with the public API deprecation. Change-Id: I29f1575acf9efdcbae4c005ee9b2eb1bb0c8e5b5 Reviewed-by: Volker Hilsheimer Reviewed-by: Qt CI Bot --- tests/auto/widgets/widgets/qstackedwidget/CMakeLists.txt | 1 + tests/auto/widgets/widgets/qstackedwidget/tst_qstackedwidget.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/auto/widgets/widgets/qstackedwidget') diff --git a/tests/auto/widgets/widgets/qstackedwidget/CMakeLists.txt b/tests/auto/widgets/widgets/qstackedwidget/CMakeLists.txt index 7ff85e29b0..628be9f25b 100644 --- a/tests/auto/widgets/widgets/qstackedwidget/CMakeLists.txt +++ b/tests/auto/widgets/widgets/qstackedwidget/CMakeLists.txt @@ -13,4 +13,5 @@ qt_internal_add_test(tst_qstackedwidget LIBRARIES Qt::Gui Qt::Widgets + Qt::WidgetsPrivate ) diff --git a/tests/auto/widgets/widgets/qstackedwidget/tst_qstackedwidget.cpp b/tests/auto/widgets/widgets/qstackedwidget/tst_qstackedwidget.cpp index 672e176808..10563137c3 100644 --- a/tests/auto/widgets/widgets/qstackedwidget/tst_qstackedwidget.cpp +++ b/tests/auto/widgets/widgets/qstackedwidget/tst_qstackedwidget.cpp @@ -11,6 +11,8 @@ #include #include +#include + class tst_QStackedWidget : public QObject { Q_OBJECT @@ -157,7 +159,7 @@ void tst_QStackedWidget::dynamicPages() le11->setFocus(); // set focus to second widget in the page sw->resize(200, 200); sw->show(); - qApp->setActiveWindow(sw); + QApplicationPrivate::setActiveWindow(sw); QVERIFY(QTest::qWaitForWindowActive(sw)); QTRY_COMPARE(QApplication::focusWidget(), le11); -- cgit v1.2.3