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/dialogs/qfiledialog/tst_qfiledialog.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp') diff --git a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp index e0d091c3bd..4a6bf52d5f 100644 --- a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp +++ b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp @@ -38,6 +38,8 @@ #include #include +#include + #if defined(Q_OS_UNIX) #include // for pathconf() on OS X #ifdef QT_BUILD_INTERNAL @@ -1118,7 +1120,7 @@ void tst_QFiledialog::focus() QFileDialog fd; fd.setDirectory(QDir::currentPath()); fd.show(); - QApplication::setActiveWindow(&fd); + QApplicationPrivate::setActiveWindow(&fd); QVERIFY(QTest::qWaitForWindowActive(&fd)); QCOMPARE(fd.isVisible(), true); QCOMPARE(QApplication::activeWindow(), static_cast(&fd)); -- cgit v1.2.3