summaryrefslogtreecommitdiffstats
path: root/src/corelib/text
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2020-06-26 08:21:15 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2020-06-29 12:35:09 +0200
commitb0f9c06a9b199a7474eb94a6292b5824364344b6 (patch)
tree15bfdcd6322d34b9dfeaf1f7b170219b0bab9fa0 /src/corelib/text
parentbe1bb192955631c44a872014fcb631efc5fcfb8a (diff)
Use QList instead of QVector in corelib implementation
Omitting state machine and docs for now. Task-number: QTBUG-84469 Change-Id: Ibfa5e7035515773461f6cdbff35299315ef65737 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'src/corelib/text')
-rw-r--r--src/corelib/text/qcollator_macx.cpp2
-rw-r--r--src/corelib/text/qcollator_posix.cpp2
-rw-r--r--src/corelib/text/qlocale.cpp2
-rw-r--r--src/corelib/text/qregexp.cpp61
-rw-r--r--src/corelib/text/qregularexpression.cpp4
-rw-r--r--src/corelib/text/qstring.cpp69
-rw-r--r--src/corelib/text/qstringtokenizer.cpp2
-rw-r--r--src/corelib/text/qstringview.cpp8
8 files changed, 71 insertions, 79 deletions
diff --git a/src/corelib/text/qcollator_macx.cpp b/src/corelib/text/qcollator_macx.cpp
index cb8e073d4a..62b3a904a0 100644
--- a/src/corelib/text/qcollator_macx.cpp
+++ b/src/corelib/text/qcollator_macx.cpp
@@ -127,7 +127,7 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const
}
//Documentation recommends having it 5 times as big as the input
- QVector<UCCollationValue> ret(string.size() * 5);
+ QList<UCCollationValue> ret(string.size() * 5);
ItemCount actualSize;
int status = UCGetCollationKey(d->collator,
reinterpret_cast<const UniChar *>(string.constData()),
diff --git a/src/corelib/text/qcollator_posix.cpp b/src/corelib/text/qcollator_posix.cpp
index ffcd214cfb..92148fa315 100644
--- a/src/corelib/text/qcollator_posix.cpp
+++ b/src/corelib/text/qcollator_posix.cpp
@@ -98,7 +98,7 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const
QVarLengthArray<wchar_t> original;
stringToWCharArray(original, string);
- QVector<wchar_t> result(original.size());
+ QList<wchar_t> result(original.size());
if (d->isC()) {
std::copy(original.cbegin(), original.cend(), result.begin());
} else {
diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp
index 6c6b371532..40defe386f 100644
--- a/src/corelib/text/qlocale.cpp
+++ b/src/corelib/text/qlocale.cpp
@@ -4261,7 +4261,7 @@ QString QLocale::formattedDataSize(qint64 bytes, int precision, DataSizeFormats
QStringList QLocale::uiLanguages() const
{
QStringList uiLanguages;
- QVector<QLocale> locales;
+ QList<QLocale> locales;
#ifndef QT_NO_SYSTEMLOCALE
if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(QSystemLocale::UILanguages, QVariant());
diff --git a/src/corelib/text/qregexp.cpp b/src/corelib/text/qregexp.cpp
index 68fc0d054f..d7a2434b52 100644
--- a/src/corelib/text/qregexp.cpp
+++ b/src/corelib/text/qregexp.cpp
@@ -51,7 +51,6 @@
#include "qstring.h"
#include "qstringlist.h"
#include "qstringmatcher.h"
-#include "qvector.h"
#include "private/qlocking_p.h"
#include <limits.h>
@@ -849,7 +848,7 @@ static bool isWord(QChar ch)
Merges two vectors of ints and puts the result into the first
one.
*/
-static void mergeInto(QVector<int> *a, const QVector<int> &b)
+static void mergeInto(QList<int> *a, const QList<int> &b)
{
int asize = a->size();
int bsize = b.size();
@@ -862,7 +861,7 @@ static void mergeInto(QVector<int> *a, const QVector<int> &b)
#endif
} else if (bsize >= 1) {
int csize = asize + bsize;
- QVector<int> c(csize);
+ QList<int> c(csize);
int i = 0, j = 0, k = 0;
while (i < asize) {
if (j < bsize) {
@@ -1035,8 +1034,6 @@ static size_t qHash(const QRegExpEngineKey &key, size_t seed = 0) noexcept
class QRegExpEngine;
-//Q_DECLARE_TYPEINFO(QVector<int>, Q_MOVABLE_TYPE);
-
/*
This is the engine state during matching.
*/
@@ -1064,7 +1061,7 @@ struct QRegExpMatchState
int slideTabSize; // size of slide table
int capturedSize;
#ifndef QT_NO_REGEXP_BACKREF
- QList<QVector<int> > sleeping; // list of back-reference sleepers
+ QList<QList<int>> sleeping; // list of back-reference sleepers
#endif
int matchLen; // length of match
int oneTestMatchedLen; // length of partial match
@@ -1094,7 +1091,7 @@ struct QRegExpAutomatonState
int atom; // which atom does this state belong to?
#endif
int match; // what does it match? (see CharClassBit and BackRefBit)
- QVector<int> outs; // out-transitions
+ QList<int> outs; // out-transitions
QMap<int, int> reenter; // atoms reentered when transiting out
QMap<int, int> anchors; // anchors met when transiting out
@@ -1176,7 +1173,7 @@ public:
bool in(QChar ch) const;
#ifndef QT_NO_REGEXP_OPTIM
- const QVector<int> &firstOccurrence() const { return occ1; }
+ const QList<int> &firstOccurrence() const { return occ1; }
#endif
#if defined(QT_DEBUG)
@@ -1184,9 +1181,9 @@ public:
#endif
private:
- QVector<QRegExpCharClassRange> r; // character ranges
+ QList<QRegExpCharClassRange> r; // character ranges
#ifndef QT_NO_REGEXP_OPTIM
- QVector<int> occ1; // first-occurrence array
+ QList<int> occ1; // first-occurrence array
#endif
uint c; // character classes
bool n; // negative?
@@ -1199,8 +1196,8 @@ struct QRegExpCharClass
#ifndef QT_NO_REGEXP_OPTIM
QRegExpCharClass() { occ1.fill(0, NumBadChars); }
- const QVector<int> &firstOccurrence() const { return occ1; }
- QVector<int> occ1;
+ const QList<int> &firstOccurrence() const { return occ1; }
+ QList<int> occ1;
#endif
};
#endif
@@ -1230,9 +1227,9 @@ public:
int createState(int bref);
#endif
- void addCatTransitions(const QVector<int> &from, const QVector<int> &to);
+ void addCatTransitions(const QList<int> &from, const QList<int> &to);
#ifndef QT_NO_REGEXP_CAPTURE
- void addPlusTransitions(const QVector<int> &from, const QVector<int> &to, int atom);
+ void addPlusTransitions(const QList<int> &from, const QList<int> &to, int atom);
#endif
#ifndef QT_NO_REGEXP_ANCHOR_ALT
@@ -1290,23 +1287,23 @@ private:
bool bruteMatch(QRegExpMatchState &matchState) const;
#endif
- QVector<QRegExpAutomatonState> s; // array of states
+ QList<QRegExpAutomatonState> s; // array of states
#ifndef QT_NO_REGEXP_CAPTURE
- QVector<QRegExpAtom> f; // atom hierarchy
+ QList<QRegExpAtom> f; // atom hierarchy
int nf; // number of atoms
int cf; // current atom
- QVector<int> captureForOfficialCapture;
+ QList<int> captureForOfficialCapture;
#endif
int officialncap; // number of captures, seen from the outside
int ncap; // number of captures, seen from the inside
#ifndef QT_NO_REGEXP_CCLASS
- QVector<QRegExpCharClass> cl; // array of character classes
+ QList<QRegExpCharClass> cl; // array of character classes
#endif
#ifndef QT_NO_REGEXP_LOOKAHEAD
- QVector<QRegExpLookahead *> ahead; // array of lookaheads
+ QList<QRegExpLookahead *> ahead; // array of lookaheads
#endif
#ifndef QT_NO_REGEXP_ANCHOR_ALT
- QVector<QRegExpAnchorAlternation> aa; // array of (a, b) pairs of anchors
+ QList<QRegExpAnchorAlternation> aa; // array of (a, b) pairs of anchors
#endif
#ifndef QT_NO_REGEXP_OPTIM
bool caretAnchored; // does the regexp start with ^?
@@ -1328,7 +1325,7 @@ private:
QString goodStr; // the string that any match has to contain
int minl; // the minimum length of a match
- QVector<int> occ1; // first-occurrence array
+ QList<int> occ1; // first-occurrence array
#endif
/*
@@ -1370,8 +1367,8 @@ private:
void addAnchorsToEngine(const Box &to) const;
QRegExpEngine *eng; // the automaton under construction
- QVector<int> ls; // the left states (firstpos)
- QVector<int> rs; // the right states (lastpos)
+ QList<int> ls; // the left states (firstpos)
+ QList<int> rs; // the right states (lastpos)
QMap<int, int> lanchors; // the left anchors
QMap<int, int> ranchors; // the right anchors
int skipanchors; // the anchors to match if the box is skipped
@@ -1387,7 +1384,7 @@ private:
int minl; // the minimum length of this box
#ifndef QT_NO_REGEXP_OPTIM
- QVector<int> occ1; // first-occurrence array
+ QList<int> occ1; // first-occurrence array
#endif
};
@@ -1502,7 +1499,7 @@ QRegExpEngine::~QRegExpEngine()
void QRegExpMatchState::prepareForMatch(QRegExpEngine *eng)
{
/*
- We use one QVector<int> for all the big data used a lot in
+ We use one QList<int> for all the big data used a lot in
matchHere() and friends.
*/
int ns = eng->s.size(); // number of states
@@ -1661,18 +1658,18 @@ int QRegExpEngine::createState(int bref)
capturing.
*/
-void QRegExpEngine::addCatTransitions(const QVector<int> &from, const QVector<int> &to)
+void QRegExpEngine::addCatTransitions(const QList<int> &from, const QList<int> &to)
{
for (int i = 0; i < from.size(); i++)
mergeInto(&s[from.at(i)].outs, to);
}
#ifndef QT_NO_REGEXP_CAPTURE
-void QRegExpEngine::addPlusTransitions(const QVector<int> &from, const QVector<int> &to, int atom)
+void QRegExpEngine::addPlusTransitions(const QList<int> &from, const QList<int> &to, int atom)
{
for (int i = 0; i < from.size(); i++) {
QRegExpAutomatonState &st = s[from.at(i)];
- const QVector<int> oldOuts = st.outs;
+ const QList<int> oldOuts = st.outs;
mergeInto(&st.outs, to);
if (f.at(atom).capture != QRegExpAtom::NoCapture) {
for (int j = 0; j < to.size(); j++) {
@@ -1971,7 +1968,7 @@ bool QRegExpMatchState::testAnchor(int i, int a, const int *capBegin)
#endif
#ifndef QT_NO_REGEXP_LOOKAHEAD
if ((a & QRegExpEngine::Anchor_LookaheadMask) != 0) {
- const QVector<QRegExpLookahead *> &ahead = eng->ahead;
+ const QList<QRegExpLookahead *> &ahead = eng->ahead;
for (j = 0; j < ahead.size(); j++) {
if ((a & (QRegExpEngine::Anchor_FirstLookahead << j)) != 0) {
QRegExpMatchState matchState;
@@ -2134,7 +2131,7 @@ bool QRegExpMatchState::matchHere()
for (j = 0; j < ncur; j++) {
int cur = curStack[j];
const QRegExpAutomatonState &scur = eng->s.at(cur);
- const QVector<int> &outs = scur.outs;
+ const QList<int> &outs = scur.outs;
for (k = 0; k < outs.size(); k++) {
int next = outs.at(k);
const QRegExpAutomatonState &snext = eng->s.at(next);
@@ -2363,7 +2360,7 @@ bool QRegExpMatchState::matchHere()
nextStack.
*/
if (needSomeSleep > 0) {
- QVector<int> zzZ(2 + 2 * ncap);
+ QList<int> zzZ(2 + 2 * ncap);
zzZ[0] = i + needSomeSleep;
zzZ[1] = next;
if (ncap > 0) {
@@ -2394,7 +2391,7 @@ bool QRegExpMatchState::matchHere()
j = 0;
while (j < sleeping.count()) {
if (sleeping.at(j)[0] == i) {
- const QVector<int> &zzZ = sleeping.at(j);
+ const QList<int> &zzZ = sleeping.at(j);
int next = zzZ[1];
const int *capBegin = zzZ.data() + 2;
const int *capEnd = zzZ.data() + 2 + ncap;
diff --git a/src/corelib/text/qregularexpression.cpp b/src/corelib/text/qregularexpression.cpp
index 45d10c24f7..44bdc2e463 100644
--- a/src/corelib/text/qregularexpression.cpp
+++ b/src/corelib/text/qregularexpression.cpp
@@ -43,8 +43,8 @@
#include <QtCore/qcoreapplication.h>
#include <QtCore/qhashfunctions.h>
+#include <QtCore/qlist.h>
#include <QtCore/qmutex.h>
-#include <QtCore/qvector.h>
#include <QtCore/qstringlist.h>
#include <QtCore/qdebug.h>
#include <QtCore/qthreadstorage.h>
@@ -787,7 +787,7 @@ struct QRegularExpressionMatchPrivate : QSharedData
// the capturedOffsets vector contains pairs of (start, end) positions
// for each captured substring
- QVector<int> capturedOffsets;
+ QList<int> capturedOffsets;
int capturedCount = 0;
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp
index dff0dbce7f..5bd063ee42 100644
--- a/src/corelib/text/qstring.cpp
+++ b/src/corelib/text/qstring.cpp
@@ -3906,9 +3906,9 @@ QString &QString::replace(const QRegularExpression &re, const QString &after)
int numCaptures = re.captureCount();
- // 1. build the backreferences vector, holding where the backreferences
+ // 1. build the backreferences list, holding where the backreferences
// are in the replacement string
- QVector<QStringCapture> backReferences;
+ QList<QStringCapture> backReferences;
const int al = after.length();
const QChar *ac = after.unicode();
@@ -3940,7 +3940,7 @@ QString &QString::replace(const QRegularExpression &re, const QString &after)
int newLength = 0; // length of the new string, with all the replacements
int lastEnd = 0;
- QVector<QStringRef> chunks;
+ QList<QStringRef> chunks;
while (iterator.hasNext()) {
QRegularExpressionMatch match = iterator.next();
int len;
@@ -4317,8 +4317,8 @@ int QString::count(const QRegularExpression &re) const
QString QString::section(const QString &sep, int start, int end, SectionFlags flags) const
{
- const QVector<QStringRef> sections = splitRef(sep, Qt::KeepEmptyParts,
- (flags & SectionCaseInsensitiveSeps) ? Qt::CaseInsensitive : Qt::CaseSensitive);
+ const QList<QStringRef> sections = splitRef(
+ sep, Qt::KeepEmptyParts, (flags & SectionCaseInsensitiveSeps) ? Qt::CaseInsensitive : Qt::CaseSensitive);
const int sectionsSize = sections.size();
if (!(flags & SectionSkipEmpty)) {
if (start < 0)
@@ -4373,10 +4373,7 @@ public:
};
Q_DECLARE_TYPEINFO(qt_section_chunk, Q_MOVABLE_TYPE);
-static QString extractSections(const QVector<qt_section_chunk> &sections,
- int start,
- int end,
- QString::SectionFlags flags)
+static QString extractSections(const QList<qt_section_chunk> &sections, int start, int end, QString::SectionFlags flags)
{
const int sectionsSize = sections.size();
@@ -4465,7 +4462,7 @@ QString QString::section(const QRegularExpression &re, int start, int end, Secti
if (flags & SectionCaseInsensitiveSeps)
sep.setPatternOptions(sep.patternOptions() | QRegularExpression::CaseInsensitiveOption);
- QVector<qt_section_chunk> sections;
+ QList<qt_section_chunk> sections;
int n = length(), m = 0, last_m = 0, last_len = 0;
QRegularExpressionMatchIterator iterator = sep.globalMatch(*this);
while (iterator.hasNext()) {
@@ -4951,30 +4948,30 @@ QByteArray QtPrivate::convertToUtf8(QStringView string)
return qt_convert_to_utf8(string);
}
-static QVector<uint> qt_convert_to_ucs4(QStringView string);
+static QList<uint> qt_convert_to_ucs4(QStringView string);
/*!
\since 4.2
- Returns a UCS-4/UTF-32 representation of the string as a QVector<uint>.
+ Returns a UCS-4/UTF-32 representation of the string as a QList<uint>.
UCS-4 is a Unicode codec and therefore it is lossless. All characters from
this string will be encoded in UCS-4. Any invalid sequence of code units in
this string is replaced by the Unicode's replacement character
(QChar::ReplacementCharacter, which corresponds to \c{U+FFFD}).
- The returned vector is not \\0'-terminated.
+ The returned list is not \\0'-terminated.
\sa fromUtf8(), toUtf8(), toLatin1(), toLocal8Bit(), QStringEncoder, fromUcs4(), toWCharArray()
*/
-QVector<uint> QString::toUcs4() const
+QList<uint> QString::toUcs4() const
{
return qt_convert_to_ucs4(*this);
}
-static QVector<uint> qt_convert_to_ucs4(QStringView string)
+static QList<uint> qt_convert_to_ucs4(QStringView string)
{
- QVector<uint> v(string.length());
+ QList<uint> v(string.length());
uint *a = const_cast<uint*>(v.constData());
QStringIterator it(string);
while (it.hasNext())
@@ -4988,19 +4985,19 @@ static QVector<uint> qt_convert_to_ucs4(QStringView string)
\internal
\relates QStringView
- Returns a UCS-4/UTF-32 representation of \a string as a QVector<uint>.
+ Returns a UCS-4/UTF-32 representation of \a string as a QList<uint>.
UCS-4 is a Unicode codec and therefore it is lossless. All characters from
this string will be encoded in UCS-4. Any invalid sequence of code units in
this string is replaced by the Unicode's replacement character
(QChar::ReplacementCharacter, which corresponds to \c{U+FFFD}).
- The returned vector is not \\0'-terminated.
+ The returned list is not \\0'-terminated.
\sa QString::toUcs4(), QStringView::toUcs4(), QtPrivate::convertToLatin1(),
QtPrivate::convertToLocal8Bit(), QtPrivate::convertToUtf8()
*/
-QVector<uint> QtPrivate::convertToUcs4(QStringView string)
+QList<uint> QtPrivate::convertToUcs4(QStringView string)
{
return qt_convert_to_ucs4(string);
}
@@ -7242,10 +7239,9 @@ QStringList QString::split(const QString &sep, Qt::SplitBehavior behavior, Qt::C
\since 5.14
\sa QStringRef split()
*/
-QVector<QStringRef> QString::splitRef(const QString &sep, Qt::SplitBehavior behavior,
- Qt::CaseSensitivity cs) const
+QList<QStringRef> QString::splitRef(const QString &sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
{
- return splitString<QVector<QStringRef>>(QStringRef(this), sep, behavior, cs);
+ return splitString<QList<QStringRef>>(QStringRef(this), sep, behavior, cs);
}
/*!
@@ -7261,10 +7257,9 @@ QStringList QString::split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensit
\overload
\since 5.14
*/
-QVector<QStringRef> QString::splitRef(QChar sep, Qt::SplitBehavior behavior,
- Qt::CaseSensitivity cs) const
+QList<QStringRef> QString::splitRef(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
{
- return splitString<QVector<QStringRef> >(QStringRef(this), QStringView(&sep, 1), behavior, cs);
+ return splitString<QList<QStringRef>>(QStringRef(this), QStringView(&sep, 1), behavior, cs);
}
/*!
@@ -7279,18 +7274,18 @@ QVector<QStringRef> QString::splitRef(QChar sep, Qt::SplitBehavior behavior,
\since 5.14
*/
-QVector<QStringRef> QStringRef::split(const QString &sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
+QList<QStringRef> QStringRef::split(const QString &sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
{
- return splitString<QVector<QStringRef> >(*this, sep, behavior, cs);
+ return splitString<QList<QStringRef>>(*this, sep, behavior, cs);
}
/*!
\overload
\since 5.14
*/
-QVector<QStringRef> QStringRef::split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
+QList<QStringRef> QStringRef::split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
{
- return splitString<QVector<QStringRef> >(*this, QStringView(&sep, 1), behavior, cs);
+ return splitString<QList<QStringRef>>(*this, QStringView(&sep, 1), behavior, cs);
}
/*!
@@ -7311,7 +7306,7 @@ QVector<QStringRef> QStringRef::split(QChar sep, Qt::SplitBehavior behavior, Qt:
*/
QList<QStringView> QStringView::split(QStringView sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
{
- return splitString<QVector<QStringView>>(QStringView(*this), sep, behavior, cs);
+ return splitString<QList<QStringView>>(QStringView(*this), sep, behavior, cs);
}
QList<QStringView> QStringView::split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
@@ -7388,16 +7383,16 @@ QStringList QString::split(const QRegularExpression &re, Qt::SplitBehavior behav
Splits the string into substring references wherever the regular expression
\a re matches, and returns the list of those strings. If \a re
does not match anywhere in the string, splitRef() returns a
- single-element vector containing this string reference.
+ single-element list containing this string reference.
\note All references are valid as long this string is alive. Destroying this
string will cause all references to be dangling pointers.
\sa split() QStringRef
*/
-QVector<QStringRef> QString::splitRef(const QRegularExpression &re, Qt::SplitBehavior behavior) const
+QList<QStringRef> QString::splitRef(const QRegularExpression &re, Qt::SplitBehavior behavior) const
{
- return splitString<QVector<QStringRef> >(QStringRef(this), re, behavior);
+ return splitString<QList<QStringRef>>(QStringRef(this), re, behavior);
}
/*!
@@ -7406,7 +7401,7 @@ QVector<QStringRef> QString::splitRef(const QRegularExpression &re, Qt::SplitBeh
Splits the string into substring views wherever the regular expression
\a re matches, and returns the list of those strings. If \a re
does not match anywhere in the string, splitRef() returns a
- single-element vector containing this string reference.
+ single-element list containing this string reference.
\note All references are valid as long this string is alive. Destroying this
string will cause all references to be dangling pointers.
@@ -11638,18 +11633,18 @@ QByteArray QStringRef::toUtf8() const
/*!
\since 4.8
- Returns a UCS-4/UTF-32 representation of the string as a QVector<uint>.
+ Returns a UCS-4/UTF-32 representation of the string as a QList<uint>.
UCS-4 is a Unicode codec and therefore it is lossless. All characters from
this string will be encoded in UCS-4. Any invalid sequence of code units in
this string is replaced by the Unicode's replacement character
(QChar::ReplacementCharacter, which corresponds to \c{U+FFFD}).
- The returned vector is not \\0'-terminated.
+ The returned list is not \\0'-terminated.
\sa toUtf8(), toLatin1(), toLocal8Bit(), QStringEncoder
*/
-QVector<uint> QStringRef::toUcs4() const
+QList<uint> QStringRef::toUcs4() const
{
return qt_convert_to_ucs4(*this);
}
diff --git a/src/corelib/text/qstringtokenizer.cpp b/src/corelib/text/qstringtokenizer.cpp
index 043269a3ac..a0316e568d 100644
--- a/src/corelib/text/qstringtokenizer.cpp
+++ b/src/corelib/text/qstringtokenizer.cpp
@@ -296,7 +296,7 @@ QT_BEGIN_NAMESPACE
\code
// assuming tok's value_type is QStringView, then...
auto tok = QStringTokenizer{~~~};
- // ... rac1 is a QVector:
+ // ... rac1 is a QList:
auto rac1 = tok.toContainer();
// ... rac2 is std::pmr::vector<QStringView>:
auto rac2 = tok.toContainer<std::pmr::vector<QStringView>>();
diff --git a/src/corelib/text/qstringview.cpp b/src/corelib/text/qstringview.cpp
index 092f58a90a..985d87ac51 100644
--- a/src/corelib/text/qstringview.cpp
+++ b/src/corelib/text/qstringview.cpp
@@ -107,7 +107,7 @@ QT_BEGIN_NAMESPACE
\note We strongly discourage the use of QList<QStringView>,
because QList is a very inefficient container for QStringViews (it would heap-allocate
- every element). Use QVector (or std::vector) to hold QStringViews instead.
+ every element). Use QList (or std::vector) to hold QStringViews instead.
\sa QString, QStringRef
*/
@@ -898,16 +898,16 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn QVector<uint> QStringView::toUcs4() const
+ \fn QList<uint> QStringView::toUcs4() const
- Returns a UCS-4/UTF-32 representation of the string as a QVector<uint>.
+ Returns a UCS-4/UTF-32 representation of the string as a QList<uint>.
UCS-4 is a Unicode codec and therefore it is lossless. All characters from
this string will be encoded in UCS-4. Any invalid sequence of code units in
this string is replaced by the Unicode replacement character
(QChar::ReplacementCharacter, which corresponds to \c{U+FFFD}).
- The returned vector is not 0-terminated.
+ The returned list is not 0-terminated.
\sa toUtf8(), toLatin1(), toLocal8Bit(), QStringEncoder
*/