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
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
(cherry picked from commit d2c9982a568181d55a9043c8646a4ee88b635fc7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
David Boddie 2024-11-18 14:43:14 +01:00 committed by Qt Cherry-pick Bot
parent e4d5537775
commit 40da8302e2
2 changed files with 3 additions and 3 deletions

View File

@ -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]
}

View File

@ -5430,7 +5430,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()
*/