From 12e30532de0e893c94e584138035d08dc98d30cf Mon Sep 17 00:00:00 2001 From: Jaishree Vyas Date: Wed, 30 Oct 2024 09:37:08 +0100 Subject: [PATCH] Doc: QString::slice uses the wrong snippet Changed the number, which caused the problem of showing the snippet. Two of the same numbers were given to the different snippets. Fixes: QTBUG-130565 Change-Id: Iba738a1bdaf5821df48bf5e222bee911c5ddf1fc Reviewed-by: Ivan Solovev (cherry picked from commit b3e5b134eeaae85025879cd0309664ce0ba1f6de) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/doc/snippets/qstring/main.cpp | 4 ++-- src/corelib/text/qstring.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/doc/snippets/qstring/main.cpp b/src/corelib/doc/snippets/qstring/main.cpp index 8b39ae2f133..0ccbb9abddf 100644 --- a/src/corelib/doc/snippets/qstring/main.cpp +++ b/src/corelib/doc/snippets/qstring/main.cpp @@ -912,11 +912,11 @@ void Widget::arrayOperator() void Widget::sliceFunction() { - //! [86] + //! [97] QString x = u"Nine pineapples"_s; x.slice(5); // x == "pineapples" x.slice(4, 3); // x == "app" - //! [86] + //! [97] } diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 8efc2dab0e5..90cff2370ee 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -5431,7 +5431,7 @@ QString QString::sliced_helper(QString &str, qsizetype pos, qsizetype n) \note The behavior is undefined if \a pos < 0, \a n < 0, or \a pos + \a n > size(). - \snippet qstring/main.cpp 86 + \snippet qstring/main.cpp 97 \sa sliced(), first(), last(), chopped(), chop(), truncate() */