summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-04-21 20:43:33 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-08-27 20:22:29 +0200
commit2436e259ced39657f22176537603da44ff4e2512 (patch)
tree001b836ef64a242bf12693d0a384e2f5da244862 /tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
parentaccc833e556ba54038d1cc7e261a936492145240 (diff)
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 <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp')
-rw-r--r--tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
index 8e78b215da..4a694ee070 100644
--- a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
+++ b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
@@ -34,6 +34,7 @@
#include <qscreen.h>
#include <QtWidgets/private/qabstractitemdelegate_p.h>
+#include <QtWidgets/private/qapplication_p.h>
Q_DECLARE_METATYPE(QAbstractItemDelegate::EndEditHint)
@@ -745,7 +746,7 @@ void tst_QItemDelegate::dateTimeEditor()
widget.setItem(0, 2, item3);
widget.show();
QVERIFY(QTest::qWaitForWindowExposed(&widget));
- QApplication::setActiveWindow(&widget);
+ QApplicationPrivate::setActiveWindow(&widget);
widget.editItem(item1);
@@ -761,7 +762,7 @@ void tst_QItemDelegate::dateTimeEditor()
timeEditor->setTime(time.addSecs(60));
widget.clearFocus();
- qApp->setActiveWindow(&widget);
+ QApplicationPrivate::setActiveWindow(&widget);
widget.setFocus();
widget.editItem(item2);
@@ -1025,7 +1026,7 @@ void tst_QItemDelegate::decoration()
TestItemDelegate delegate;
table.setItemDelegate(&delegate);
table.show();
- QApplication::setActiveWindow(&table);
+ QApplicationPrivate::setActiveWindow(&table);
QVERIFY(QTest::qWaitForWindowActive(&table));
QVariant value;
@@ -1280,7 +1281,7 @@ void tst_QItemDelegate::enterKey()
QListView view;
view.setModel(&model);
view.show();
- QApplication::setActiveWindow(&view);
+ QApplicationPrivate::setActiveWindow(&view);
view.setFocus();
QVERIFY(QTest::qWaitForWindowActive(&view));
@@ -1340,7 +1341,7 @@ void tst_QItemDelegate::task257859_finalizeEdit()
QListView view;
view.setModel(&model);
view.show();
- QApplication::setActiveWindow(&view);
+ QApplicationPrivate::setActiveWindow(&view);
view.setFocus();
QVERIFY(QTest::qWaitForWindowActive(&view));
@@ -1402,7 +1403,7 @@ void tst_QItemDelegate::comboBox()
widget.setItem(0, 0, item1);
widget.show();
QVERIFY(QTest::qWaitForWindowExposed(&widget));
- QApplication::setActiveWindow(&widget);
+ QApplicationPrivate::setActiveWindow(&widget);
widget.editItem(item1);
@@ -1467,7 +1468,7 @@ void tst_QItemDelegate::testLineEditValidation()
view.setItemDelegate(&delegate);
view.show();
view.setFocus();
- QApplication::setActiveWindow(&view);
+ QApplicationPrivate::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
QPointer<QLineEdit> editor;