From 859af49b97f77f1499349112f623469506c22696 Mon Sep 17 00:00:00 2001 From: Jaishree Vyas Date: Wed, 29 May 2024 11:12:47 +0200 Subject: [PATCH] Doc: Documentation for QStringList::replaceInStrings Added the text as a \note in QString::replace and QStringlist::replace to make it more visible to the users. Fixes: QTBUG-63485 Pick-to: 6.7 Change-Id: I519ab079ec86103a768f313cbc5ac625a0170839 Reviewed-by: Ivan Solovev (cherry picked from commit 3e56757d651ffcba9ea65aa990b4e02b05e00b17) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/text/qstring.cpp | 3 +++ src/corelib/text/qstringlist.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index ad0d062e348..fd276e1ac6a 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -3786,6 +3786,9 @@ static void replace_helper(QString &str, QSpan indices, qsizetype blen, but \a position + \a n goes outside the strings range, then \a n will be adjusted to stop at the end of the string. + \note If you use an empty \a before argument, the \a after argument will be + inserted \e {before and after} each character of the string. + Example: \snippet qstring/main.cpp 40 diff --git a/src/corelib/text/qstringlist.cpp b/src/corelib/text/qstringlist.cpp index 61923e0b3f2..2cc5d0c7f72 100644 --- a/src/corelib/text/qstringlist.cpp +++ b/src/corelib/text/qstringlist.cpp @@ -382,6 +382,9 @@ QStringList QtPrivate::QStringList_filter(const QStringList *that, const QRegula text replaced with the \a after text wherever the \a before text is found. + \note If you use an empty \a before argument, the \a after argument will be + inserted \e {before and after} each character of the string. + \include qstringlist.cpp comparison-case-sensitivity For example: