diff options
| author | Marc Mutz <marc.mutz@qt.io> | 2025-07-18 11:01:47 +0200 |
|---|---|---|
| committer | Marc Mutz <marc.mutz@qt.io> | 2025-07-19 07:55:27 +0200 |
| commit | 897567c4eef02be6e22e6f15df66a473dca966c5 (patch) | |
| tree | 2c5572c96fc20e71fd34635285a4234fd554033b /src/corelib/io/qdebug.cpp | |
| parent | 99dd2bb8115d5d136192bbe261ba1f3cec441845 (diff) | |
QTextStream: prefer QStringView overload of Private::putString()
This call is safer than the (ptr, n, bool=false) one, which may
accidentally resolve to (view, bool) if decltype(ptr) is "wrong".
This is in preparation of removing said putString() overload (and the
bool parameter).
Task-number: QTBUG-138520
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I93ff89322468558f7da723ae47a1d67852cc59e6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/io/qdebug.cpp')
| -rw-r--r-- | src/corelib/io/qdebug.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp index 501b6e7a946..be106dae5e6 100644 --- a/src/corelib/io/qdebug.cpp +++ b/src/corelib/io/qdebug.cpp @@ -313,7 +313,7 @@ void QDebug::putString(const QChar *begin, size_t length) if (stream->noQuotes) { // no quotes, write the string directly too (no pretty-printing) // this respects the QTextStream state, though - stream->ts.d_ptr->putString(begin, qsizetype(length)); + stream->ts.d_ptr->putString(QStringView{begin, qsizetype(length)}); } else { // we'll reset the QTextStream formatting mechanisms, so save the state QDebugStateSaver saver(*this); |
