diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp index 46bbd2b2a5a..e57c867f5a4 100644 --- a/src/corelib/text/qbytearray.cpp +++ b/src/corelib/text/qbytearray.cpp @@ -4779,11 +4779,13 @@ QByteArray QByteArray::toPercentEncoding(const QByteArray &exclude, const QByteA \sa QStringLiteral */ +#if QT_DEPRECATED_SINCE(6, 8) /*! \fn QtLiterals::operator""_qba(const char *str, size_t size) \relates QByteArray \since 6.2 + \deprecated [6.8] Use \c _ba from Qt::StringLiterals namespace instead. Literal operator that creates a QByteArray out of the first \a size characters in the char string literal \a str. @@ -4801,6 +4803,7 @@ QByteArray QByteArray::toPercentEncoding(const QByteArray &exclude, const QByteA \sa QByteArrayLiteral, QtLiterals::operator""_qs(const char16_t *str, size_t size) */ +#endif // QT_DEPRECATED_SINCE(6, 8) /*! \fn Qt::Literals::StringLiterals::operator""_ba(const char *str, size_t size) diff --git a/src/corelib/text/qbytearray.h b/src/corelib/text/qbytearray.h index 8c7594ccba4..ae7bf53af04 100644 --- a/src/corelib/text/qbytearray.h +++ b/src/corelib/text/qbytearray.h @@ -704,10 +704,15 @@ inline QByteArray operator"" _ba(const char *str, size_t size) noexcept } // Qt inline namespace QtLiterals { +#if QT_DEPRECATED_SINCE(6, 8) + +QT_DEPRECATED_VERSION_X_6_8("Use _ba from Qt::StringLiterals namespace instead.") inline QByteArray operator"" _qba(const char *str, size_t size) noexcept { return Qt::StringLiterals::operator""_ba(str, size); } + +#endif // QT_DEPRECATED_SINCE(6, 8) } // QtLiterals QT_END_NAMESPACE diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 00f899ee990..acf02832da4 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -10987,11 +10987,13 @@ QString QString::toHtmlEscaped() const \sa QByteArrayLiteral */ +#if QT_DEPRECATED_SINCE(6, 8) /*! \fn QtLiterals::operator""_qs(const char16_t *str, size_t size) \relates QString \since 6.2 + \deprecated [6.8] Use \c _s from Qt::StringLiterals namespace instead. Literal operator that creates a QString out of the first \a size characters in the char16_t string literal \a str. @@ -11009,6 +11011,7 @@ QString QString::toHtmlEscaped() const \sa QStringLiteral, QtLiterals::operator""_qba(const char *str, size_t size) */ +#endif // QT_DEPRECATED_SINCE(6, 8) /*! \fn Qt::Literals::StringLiterals::operator""_s(const char16_t *str, size_t size) diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h index e26547a1f12..922423502c4 100644 --- a/src/corelib/text/qstring.h +++ b/src/corelib/text/qstring.h @@ -1677,10 +1677,15 @@ inline QString operator"" _s(const char16_t *str, size_t size) noexcept } // Qt inline namespace QtLiterals { +#if QT_DEPRECATED_SINCE(6, 8) + +QT_DEPRECATED_VERSION_X_6_8("Use _s from Qt::StringLiterals namespace instead.") inline QString operator"" _qs(const char16_t *str, size_t size) noexcept { return Qt::StringLiterals::operator""_s(str, size); } + +#endif // QT_DEPRECATED_SINCE(6, 8) } // QtLiterals QT_END_NAMESPACE diff --git a/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp index e92011aeb80..582207e0068 100644 --- a/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp +++ b/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp @@ -2238,8 +2238,9 @@ void tst_QByteArray::userDefinedLiterals() QVERIFY(str2.capacity() >= str2.length()); } +#if QT_DEPRECATED_SINCE(6, 8) { - QByteArray str = "abcd"_qba; + QT_IGNORE_DEPRECATIONS(QByteArray str = "abcd"_qba;) QVERIFY(str.length() == 4); QCOMPARE(str.capacity(), 0); @@ -2259,6 +2260,7 @@ void tst_QByteArray::userDefinedLiterals() QVERIFY(str2.data() != s); QVERIFY(str2.capacity() >= str2.length()); } +#endif // QT_DEPRECATED_SINCE(6, 8) } void tst_QByteArray::toUpperLower_data() diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp index 71f3712dd48..a7d824d670a 100644 --- a/tests/auto/corelib/text/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp @@ -7053,8 +7053,9 @@ void tst_QString::userDefinedLiterals() QVERIFY(str2.capacity() >= str2.length()); } +#if QT_DEPRECATED_SINCE(6, 8) { - QString str = u"abcd"_qs; + QT_IGNORE_DEPRECATIONS(QString str = u"abcd"_qs;) QVERIFY(str.length() == 4); QCOMPARE(str.capacity(), 0); @@ -7074,6 +7075,7 @@ void tst_QString::userDefinedLiterals() QVERIFY(str2.data() != s); QVERIFY(str2.capacity() >= str2.length()); } +#endif // QT_DEPRECATED_SINCE(6, 8) } void tst_QString::eightBitLiterals_data()