From 651b5150741af374214e9d28fdd81f991f2c084c Mon Sep 17 00:00:00 2001 From: Juha Vuolle Date: Fri, 20 Dec 2024 12:02:35 +0200 Subject: [PATCH] Change QImage::mirrored() deprecation from Qt 6.10 to Qt 6.13 The deprecations aren't urgent, and allowing more time for users to adapt is appropriate. In addition, also suppress the deprecation warnings when compiling the related autotest. Resulted from API-review. Amends: 577946c1f05aaaa2a3f9682001aeb4144386b26b Task-number: QTBUG-132090 Change-Id: Ia0c07ab510a9a9c8722892fcd94f58f6ec287059 Reviewed-by: Volker Hilsheimer Reviewed-by: Allan Sandfeld Jensen (cherry picked from commit 0aa07ce77237dacc58de5939d5a239fb8997da7a) Reviewed-by: Qt Cherry-pick Bot --- src/gui/image/qimage.cpp | 4 ++-- src/gui/image/qimage.h | 8 ++++---- tests/auto/gui/image/qimage/tst_qimage.cpp | 6 ++++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 06ae65e3f63..cd4979268a8 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -3293,7 +3293,7 @@ QImage QImage::createMaskFromColor(QRgb color, Qt::MaskMode mode) const /*! \fn QImage QImage::mirrored(bool horizontal = false, bool vertical = true) const & \fn QImage QImage::mirrored(bool horizontal = false, bool vertical = true) && - \deprecated [6.9] Use flipped(Qt::Orientations) instead. + \deprecated [6.13] Use flipped(Qt::Orientations) instead. Returns a mirror of the image, mirrored in the horizontal and/or the vertical direction depending on whether \a horizontal and \a @@ -3307,7 +3307,7 @@ QImage QImage::createMaskFromColor(QRgb color, Qt::MaskMode mode) const /*! \fn void QImage::mirror(bool horizontal = false, bool vertical = true) \since 6.0 - \deprecated [6.9] Use flip(Qt::Orientations) instead. + \deprecated [6.13] Use flip(Qt::Orientations) instead. Mirrors of the image in the horizontal and/or the vertical direction depending on whether \a horizontal and \a vertical are set to true or false. diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h index e30ec551322..17c8da1ca3f 100644 --- a/src/gui/image/qimage.h +++ b/src/gui/image/qimage.h @@ -215,14 +215,14 @@ public: [[nodiscard]] QImage scaledToHeight(int h, Qt::TransformationMode mode = Qt::FastTransformation) const; [[nodiscard]] QImage transformed(const QTransform &matrix, Qt::TransformationMode mode = Qt::FastTransformation) const; static QTransform trueMatrix(const QTransform &, int w, int h); -#if QT_DEPRECATED_SINCE(6, 10) - QT_DEPRECATED_VERSION_X_6_10("Use flipped(Qt::Orientations) instead") +#if QT_DEPRECATED_SINCE(6, 13) + QT_DEPRECATED_VERSION_X_6_13("Use flipped(Qt::Orientations) instead") [[nodiscard]] QImage mirrored(bool horizontally = false, bool vertically = true) const & { return mirrored_helper(horizontally, vertically); } - QT_DEPRECATED_VERSION_X_6_10("Use flipped(Qt::Orientations) instead") + QT_DEPRECATED_VERSION_X_6_13("Use flipped(Qt::Orientations) instead") [[nodiscard]] QImage mirrored(bool horizontally = false, bool vertically = true) && { mirrored_inplace(horizontally, vertically); return std::move(*this); } - QT_DEPRECATED_VERSION_X_6_10("Use flip(Qt::Orientations) instead") + QT_DEPRECATED_VERSION_X_6_13("Use flip(Qt::Orientations) instead") void mirror(bool horizontally = false, bool vertically = true) { mirrored_inplace(horizontally, vertically); } #endif diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp index 5df5278783d..7ff5c1d74dc 100644 --- a/tests/auto/gui/image/qimage/tst_qimage.cpp +++ b/tests/auto/gui/image/qimage/tst_qimage.cpp @@ -2768,7 +2768,8 @@ void tst_QImage::mirrored_data() QTest::newRow("Format_MonoLSB, horizontal+vertical, non-aligned") << QImage::Format_MonoLSB << true << true << 21 << 16; } -#if QT_DEPRECATED_SINCE(6, 10) +#if QT_DEPRECATED_SINCE(6, 13) +QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED void tst_QImage::mirrored() { QFETCH(QImage::Format, format); @@ -2826,7 +2827,8 @@ void tst_QImage::mirrored() QCOMPARE(image.pixel(j,i), imageMirrored.pixel(j,i)); } } -#endif +QT_WARNING_POP +#endif // QT_DEPRECATED_SINCE(6, 13) void tst_QImage::flipped_data() {