diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 942df9e0dd..fd51ce321d 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -8940,7 +8940,7 @@ ownership of it, no memory is freed when instances are destroyed. Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first character in the string. - \sa cbegin(), end(), rbegin(), rend() + \sa cbegin(), constBegin(), end(), constEnd(), rbegin(), rend() */ /*! @@ -8949,7 +8949,16 @@ ownership of it, no memory is freed when instances are destroyed. Same as begin(). - \sa begin(), cend(), rbegin(), rend() + \sa begin(), constBegin(), cend(), constEnd(), rbegin(), rend() +*/ + +/*! + \fn QStringRef::const_iterator QStringRef::constBegin() const + \since 5.9 + + Same as begin(). + + \sa begin(), cend(), constEnd(), rbegin(), rend() */ /*! @@ -8959,7 +8968,7 @@ ownership of it, no memory is freed when instances are destroyed. Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary character after the last character in the list. - \sa cbegin(), end(), rbegin(), rend() + \sa cbegin(), constBegin(), end(), constEnd(), rbegin(), rend() */ /*! \fn QStringRef::const_iterator QStringRef::cend() const @@ -8967,7 +8976,15 @@ ownership of it, no memory is freed when instances are destroyed. Same as end(). - \sa end(), cbegin(), rbegin(), rend() + \sa end(), constEnd(), cbegin(), constBegin(), rbegin(), rend() +*/ + +/*! \fn QStringRef::const_iterator QStringRef::constEnd() const + \since 5.9 + + Same as end(). + + \sa end(), cend(), cbegin(), constBegin(), rbegin(), rend() */ /*! diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 8a53a8f5be..8b7528577c 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -1473,8 +1473,10 @@ public: inline const_iterator begin() const { return unicode(); } inline const_iterator cbegin() const { return unicode(); } + inline const_iterator constBegin() const { return unicode(); } inline const_iterator end() const { return unicode() + size(); } inline const_iterator cend() const { return unicode() + size(); } + inline const_iterator constEnd() const { return unicode() + size(); } inline const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); } inline const_reverse_iterator crbegin() const { return rbegin(); } inline const_reverse_iterator rend() const { return const_reverse_iterator(begin()); }