From 12535b0c03bb4e5f4a8682623b0366d4d65b9b54 Mon Sep 17 00:00:00 2001 From: Ivan Solovev Date: Mon, 11 Jul 2022 17:01:42 +0200 Subject: [PATCH] QtBase: #ifdef out definitions of deprecated methods Some of the deprecated methods didn't have their definitions guarded by if QT_DEPRECATED_SINCE(MAJ, MIN) This patch fixes such cases over all QtBase. Task-number: QTBUG-104857 Pick-to: 6.4 6.3 6.2 Change-Id: I0106128f3a35a30c9f2949819f39076e773559e7 Reviewed-by: Volker Hilsheimer Reviewed-by: Qt CI Bot Reviewed-by: Marc Mutz --- src/gui/kernel/qevent.cpp | 2 ++ src/gui/kernel/qeventpoint.cpp | 3 ++- src/gui/kernel/qpointingdevice.cpp | 2 ++ src/gui/kernel/qsurfaceformat.cpp | 3 +++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 59702ae4b0..b1ad2753fe 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -4430,6 +4430,7 @@ QTouchEvent::QTouchEvent(QEvent::Type eventType, } } +#if QT_DEPRECATED_SINCE(6, 0) /*! \deprecated [6.0] Use another constructor. @@ -4449,6 +4450,7 @@ QTouchEvent::QTouchEvent(QEvent::Type eventType, for (QEventPoint &point : m_points) QMutableEventPoint::setDevice(point, device); } +#endif // QT_DEPRECATED_SINCE(6, 0) Q_IMPL_EVENT_COMMON(QTouchEvent) diff --git a/src/gui/kernel/qeventpoint.cpp b/src/gui/kernel/qeventpoint.cpp index 4030ebce0c..922550ca47 100644 --- a/src/gui/kernel/qeventpoint.cpp +++ b/src/gui/kernel/qeventpoint.cpp @@ -430,6 +430,7 @@ QPointF QEventPoint::normalizedPosition() const return (globalPosition() - geom.topLeft()) / geom.width(); } +#if QT_DEPRECATED_SINCE(6, 0) /*! \deprecated [6.0] Use globalPressPosition() instead. @@ -467,7 +468,7 @@ QPointF QEventPoint::lastNormalizedPos() const return QPointF(); return (globalLastPosition() - geom.topLeft()) / geom.width(); } - +#endif // QT_DEPRECATED_SINCE(6, 0) /*! \internal This class is explicitly shared, which means if you construct an event and diff --git a/src/gui/kernel/qpointingdevice.cpp b/src/gui/kernel/qpointingdevice.cpp index e84ba32f4a..d9ce0b0cf9 100644 --- a/src/gui/kernel/qpointingdevice.cpp +++ b/src/gui/kernel/qpointingdevice.cpp @@ -145,6 +145,7 @@ QPointingDevice::QPointingDevice(QPointingDevicePrivate &d, QObject *parent) { } +#if QT_DEPRECATED_SINCE(6, 0) /*! \internal \deprecated [6.0] Please use the constructor rather than setters. @@ -195,6 +196,7 @@ void QPointingDevice::setMaximumTouchPoints(int c) Q_D(QPointingDevice); d->maximumTouchPoints = c; } +#endif // QT_DEPRECATED_SINCE(6, 0) /*! Returns the pointer type. diff --git a/src/gui/kernel/qsurfaceformat.cpp b/src/gui/kernel/qsurfaceformat.cpp index 9227b47907..cc2bbea551 100644 --- a/src/gui/kernel/qsurfaceformat.cpp +++ b/src/gui/kernel/qsurfaceformat.cpp @@ -717,8 +717,10 @@ void QSurfaceFormat::setColorSpace(const QColorSpace &colorSpace) } } +#if QT_DEPRECATED_SINCE(6, 0) /*! \overload + \deprecated [6.0] Use setColorSpace(QColorSpace) instead. Sets the colorspace to one of the predefined values. @@ -737,6 +739,7 @@ void QSurfaceFormat::setColorSpace(ColorSpace colorSpace) break; } } +#endif // QT_DEPRECATED_SINCE(6, 0) /*! \return the color space.