From d2c9982a568181d55a9043c8646a4ee88b635fc7 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 18 Nov 2024 14:43:14 +0100 Subject: [PATCH] doc: Fix QString::slice() code example The snippet referred to had a duplicate identifier to an earlier snippet in the snippet file, causing that one to be quoted instead. Change-Id: Id46f6da807806f874291cd5d4c25b8884e511cfc Pick-to: 6.8 Reviewed-by: Nicholas Bennett --- 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 0ccbb9abddf..5e3fa647dd1 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() { - //! [97] + //! [slice97] QString x = u"Nine pineapples"_s; x.slice(5); // x == "pineapples" x.slice(4, 3); // x == "app" - //! [97] + //! [slice97] } diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index f09fd57037b..6f2511762bb 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -5427,7 +5427,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 97 + \snippet qstring/main.cpp slice97 \sa sliced(), first(), last(), chopped(), chop(), truncate() */