summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qdebug.cpp
diff options
context:
space:
mode:
authorVille Voutilainen <ville.voutilainen@qt.io>2022-09-21 00:08:45 +0300
committerVille Voutilainen <ville.voutilainen@qt.io>2022-09-27 14:12:11 +0300
commite08f05ac6e785c39ac257ee67b03572e3194bc0e (patch)
treef82a00a4b8b4609f33a6931fbffa2f798bb8f376 /src/corelib/io/qdebug.cpp
parent9a23a3d1b44fbd30097b9c7c7eb5a63e93d8751b (diff)
QDebug: Support standard strings and string views directly
[ChangeLog][QtCore][QDebug] QDebug now supports printing std::strings and std::string_views (and their wide, u16, and u32 variants) directly. Task-number: QTBUG-96878 Change-Id: I7baf4fe688bfff50580b1cee9417af13949374cc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qdebug.cpp')
-rw-r--r--src/corelib/io/qdebug.cpp73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp
index f07bb05c5b..61d67ecee5 100644
--- a/src/corelib/io/qdebug.cpp
+++ b/src/corelib/io/qdebug.cpp
@@ -764,6 +764,79 @@ QDebug &QDebug::resetFormat()
*/
/*!
+ \since 6.5
+ \fn QDebug &QDebug::operator<<(const std::string &s)
+
+ Converts \a s to a QUtf8StringView,
+ writes the result to the stream and returns
+ a reference to the stream.
+*/
+
+/*!
+ \since 6.5
+ \fn QDebug &QDebug::operator<<(std::string_view s)
+
+ Converts \a s to a QUtf8StringView,
+ writes the result to the stream and returns
+ a reference to the stream.
+*/
+
+
+/*!
+ \since 6.5
+ \fn QDebug &QDebug::operator<<(const std::wstring &s)
+
+ Converts \a s to a QString via QString::fromStdWString(),
+ writes the result to the stream and returns
+ a reference to the stream.
+*/
+
+/*!
+ \since 6.5
+ \fn QDebug &QDebug::operator<<(std::wstring_view s)
+
+ Converts \a s to a QString via QString::fromWCharArray(),
+ writes the result to the stream and returns
+ a reference to the stream.
+*/
+
+/*!
+ \since 6.5
+ \fn QDebug &QDebug::operator<<(const std::u16string &s)
+
+ Converts \a s to a QStringView,
+ writes the result to the stream and returns
+ a reference to the stream.
+*/
+
+/*!
+ \since 6.5
+ \fn QDebug &QDebug::operator<<(std::u16string_view s)
+
+ Converts \a s to a QStringView,
+ writes the result to the stream and returns
+ a reference to the stream.
+*/
+
+/*!
+ \since 6.5
+ \fn QDebug &QDebug::operator<<(const std::u32string &s)
+
+ Converts \a s to a QString via QString::fromUcs4(),
+ writes the result to the stream and returns
+ a reference to the stream.
+*/
+
+/*!
+ \since 6.5
+ \fn QDebug &QDebug::operator<<(std::u32string_view s)
+
+ Converts \a s to a QString via QString::fromUcs4(),
+ writes the result to the stream and returns
+ a reference to the stream.
+*/
+
+/*!
\fn template <class T> QString QDebug::toString(T &&object)
\since 6.0