summaryrefslogtreecommitdiffstats
path: root/examples/corelib/tools/customtype/message.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/corelib/tools/customtype/message.cpp')
-rw-r--r--examples/corelib/tools/customtype/message.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/corelib/tools/customtype/message.cpp b/examples/corelib/tools/customtype/message.cpp
index da44909893..948e323dbf 100644
--- a/examples/corelib/tools/customtype/message.cpp
+++ b/examples/corelib/tools/customtype/message.cpp
@@ -60,8 +60,7 @@ Message::Message(const QString &body, const QStringList &headers)
//! [custom type streaming operator]
QDebug operator<<(QDebug dbg, const Message &message)
{
- const QString body = message.body();
- QList<QStringRef> pieces = body.splitRef(QLatin1String("\r\n"), Qt::SkipEmptyParts);
+ QList<QStringView> pieces = message.body().split(u"\r\n", Qt::SkipEmptyParts);
if (pieces.isEmpty())
dbg.nospace() << "Message()";
else if (pieces.size() == 1)
@@ -73,7 +72,7 @@ QDebug operator<<(QDebug dbg, const Message &message)
//! [custom type streaming operator]
//! [getter functions]
-QString Message::body() const
+QStringView Message::body() const
{
return m_body;
}