summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/kernel/qapplication
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2022-07-11 11:59:14 +0200
committerIvan Solovev <ivan.solovev@qt.io>2022-07-21 19:59:07 +0200
commit68ea9c022701359b447be076888331a4f9d9085b (patch)
tree139dfd03e7b03cb2fe05d408ae5cc2f3411b37bf /tests/auto/widgets/kernel/qapplication
parent24de000a9cb0b2dc2f959fa65502ef805a4fc544 (diff)
QGuiApplication: do not emit deprecated signals
... when QT_DISABLE_DEPRECATED_BEFORE is past the deprecation version. This commit actually stops using the deprecated signals when we build Qt with QT_DISABLE_DEPRECATED_BEFORE >= 0x060000. Otherwise we will get a compilation error because the signals will be removed. Task-number: QTBUG-104857 Pick-to: 6.4 6.3 6.2 Change-Id: Ie513ecc9451bf2d88f80857cf19f3d2b4958d022 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'tests/auto/widgets/kernel/qapplication')
-rw-r--r--tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
index 59cc7f0884..3db9953471 100644
--- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
+++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
@@ -215,10 +215,12 @@ void tst_QApplication::staticSetup()
EventWatcher()
{
qApp->installEventFilter(this);
+#if QT_DEPRECATED_SINCE(6, 0)
QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED
QObject::connect(qApp, &QApplication::paletteChanged, [&]{ ++palette_changed; });
QObject::connect(qApp, &QApplication::fontChanged, [&]{ ++font_changed; });
QT_WARNING_POP
+#endif
}
protected:
@@ -248,8 +250,13 @@ QT_WARNING_POP
font.setBold(!font.bold());
qApp->setFont(font);
QApplication::processEvents();
+#if QT_DEPRECATED_SINCE(6, 0)
QCOMPARE(watcher.palette_changed, 2);
QCOMPARE(watcher.font_changed, 2);
+#else
+ QCOMPARE(watcher.palette_changed, 1);
+ QCOMPARE(watcher.font_changed, 1);
+#endif
}