From 3ccd1d2d835a623acff2b6ac52f8b1d5ec9ce108 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Fri, 18 Nov 2022 15:22:15 +0100 Subject: [PATCH] QStringView::split: doc tidies QStringView is a borrowed range, so views into it are always valid, even if the QStringView itself is destroyed. Clarify the comment. Fix another typo (referring to the view as "string") as well. Pick-to: 6.2 6.4 Change-Id: I8a4f45494d44d5a47e3c1f764f12c899ad7ee83d Reviewed-by: Marc Mutz Reviewed-by: hjk --- src/corelib/text/qstring.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index ae0f60b49c..a1a5e85b56 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -7827,14 +7827,15 @@ QStringList QString::split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensit \fn QList QStringView::split(QStringView sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const - Splits the string into substring views wherever \a sep occurs, and + Splits the view into substring views wherever \a sep occurs, and returns the list of those string views. See QString::split() for how \a sep, \a behavior and \a cs interact to form the result. - \note All views are valid as long as this string is. Destroying this - string will cause all views to be dangling pointers. + \note All the returned views are valid as long as the data referenced by + this string view is valid. Destroying the data will cause all views to + become dangling. \since 6.0 */