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 <volker.hilsheimer@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 0aa07ce77237dacc58de5939d5a239fb8997da7a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Juha Vuolle 2024-12-20 12:02:35 +02:00 committed by Qt Cherry-pick Bot
parent 1319dcf472
commit 651b515074
3 changed files with 10 additions and 8 deletions

View File

@ -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.

View File

@ -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

View File

@ -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()
{