diff options
| author | Marc Mutz <marc.mutz@qt.io> | 2024-05-13 13:26:49 +0200 |
|---|---|---|
| committer | Marc Mutz <marc.mutz@qt.io> | 2024-12-19 08:36:04 +0100 |
| commit | b815c6f7fd71086c97fe6e9aa9472154be5fcc57 (patch) | |
| tree | 35c1929bb63e59b99d61f9a28e2ae871a3db5adc | |
| parent | 38c51dcfc478d9aa759a25978a64f9f369ce0952 (diff) | |
QTextStream: port from QScopedPointer to unique_ptr
In preparation of adding QT_NO_SCOPED_PONTER, which would be rather
pointless for users if public headers continued to mention the type.
Pick-to: 6.9 6.8
Task-number: QTBUG-132213
Change-Id: I6539e83158ab34e4fa4bd22b6d0ac5629a3b6db9
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| -rw-r--r-- | src/corelib/io/qdebug.cpp | 4 | ||||
| -rw-r--r-- | src/corelib/serialization/qtextstream.h | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp index fc70e066f78..ff9c96ca4d0 100644 --- a/src/corelib/io/qdebug.cpp +++ b/src/corelib/io/qdebug.cpp @@ -318,7 +318,7 @@ void QDebug::putString(const QChar *begin, size_t length) // we'll reset the QTextStream formatting mechanisms, so save the state QDebugStateSaver saver(*this); stream->ts.d_ptr->params.reset(); - putEscapedString(stream->ts.d_ptr.data(), reinterpret_cast<const char16_t *>(begin), length); + putEscapedString(stream->ts.d_ptr.get(), reinterpret_cast<const char16_t *>(begin), length); } } @@ -338,7 +338,7 @@ void QDebug::putByteArray(const char *begin, size_t length, Latin1Content conten // we'll reset the QTextStream formatting mechanisms, so save the state QDebugStateSaver saver(*this); stream->ts.d_ptr->params.reset(); - putEscapedString(stream->ts.d_ptr.data(), reinterpret_cast<const uchar *>(begin), + putEscapedString(stream->ts.d_ptr.get(), reinterpret_cast<const uchar *>(begin), length, content == ContainsLatin1); } } diff --git a/src/corelib/serialization/qtextstream.h b/src/corelib/serialization/qtextstream.h index 7a0fc42a68b..84fa14ec5ed 100644 --- a/src/corelib/serialization/qtextstream.h +++ b/src/corelib/serialization/qtextstream.h @@ -6,9 +6,10 @@ #include <QtCore/qiodevicebase.h> #include <QtCore/qchar.h> -#include <QtCore/qscopedpointer.h> #include <QtCore/qstringconverter_base.h> +#include <memory> + #include <stdio.h> #if 0 @@ -174,7 +175,7 @@ private: friend class QDebugStateSaverPrivate; friend class QDebug; - QScopedPointer<QTextStreamPrivate> d_ptr; + std::unique_ptr<QTextStreamPrivate> d_ptr; }; Q_DECLARE_OPERATORS_FOR_FLAGS(QTextStream::NumberFlags) |
