From 68ea9c022701359b447be076888331a4f9d9085b Mon Sep 17 00:00:00 2001 From: Ivan Solovev Date: Mon, 11 Jul 2022 11:59:14 +0200 Subject: 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 Reviewed-by: Marc Mutz --- src/gui/kernel/qguiapplication.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/gui') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 746c5dad53..cb20eb3f04 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -3401,6 +3401,7 @@ QPalette QGuiApplicationPrivate::basePalette() const void QGuiApplicationPrivate::handlePaletteChanged(const char *className) { +#if QT_DEPRECATED_SINCE(6, 0) if (!className) { Q_ASSERT(app_pal); QT_WARNING_PUSH @@ -3408,6 +3409,9 @@ QT_WARNING_DISABLE_DEPRECATED emit qGuiApp->paletteChanged(*QGuiApplicationPrivate::app_pal); QT_WARNING_POP } +#else + Q_UNUSED(className); +#endif // QT_DEPRECATED_SINCE(6, 0) if (is_app_running && !is_app_closing) { QEvent event(QEvent::ApplicationPaletteChange); @@ -3466,10 +3470,14 @@ void QGuiApplication::setFont(const QFont &font) if (emitChange && qGuiApp) { auto font = *QGuiApplicationPrivate::app_font; locker.unlock(); +#if QT_DEPRECATED_SINCE(6, 0) QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED emit qGuiApp->fontChanged(font); QT_WARNING_POP +#else + Q_UNUSED(font); +#endif // QT_DEPRECATED_SINCE(6, 0) QEvent event(QEvent::ApplicationFontChange); QGuiApplication::sendEvent(qGuiApp, &event); } -- cgit v1.2.3