summaryrefslogtreecommitdiffstats
path: root/src/corelib/text
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2022-03-21 14:44:21 +0100
committerSona Kurazyan <sona.kurazyan@qt.io>2022-05-02 12:23:56 +0200
commit34242f843ec41b63c706e4604ac3a65805d11107 (patch)
treeb8b062e87ee4a8150536e3758ef3772f1dc50ba0 /src/corelib/text
parent651ba6535c4dc707fb9a473f974f0e27bac9eb98 (diff)
Deprecate _qs and _qba literal operators in favor of _s and _ba
[ChangeLog][QtCore] Deprecated _qs and _qba literal operators for QString and QByteArray in favor of _s and _ba in the Qt::Literals::StringLiterals namespace. Task-number: QTBUG-101408 Change-Id: I26aee0055e3b4c1860de6eda8e0eb857c5b3e11a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text')
-rw-r--r--src/corelib/text/qbytearray.cpp3
-rw-r--r--src/corelib/text/qbytearray.h5
-rw-r--r--src/corelib/text/qstring.cpp3
-rw-r--r--src/corelib/text/qstring.h5
4 files changed, 16 insertions, 0 deletions
diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp
index 46bbd2b2a5..e57c867f5a 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 8c7594ccba..ae7bf53af0 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 00f899ee99..acf02832da 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 e26547a1f1..922423502c 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