Doc: fix warnings for QSetIterator see-alsos

Amends 0306247f5a5d057fedfa183da06a78cc41139d1d, which removed some APIs
from QSetIterator as they couldn't be implemented without operator--.
That resulted in qdoc warnings, which this patch removes by splitting
the QSetIterator documentation into a separate block that quotes the
previously shared documentation text, but uses a reduced set of see-also
links.

Change-Id: I2aac59b927a36216a718aa8e5d092ea4d9f6c15b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
This commit is contained in:
Volker Hilsheimer 2023-05-16 10:12:32 +02:00 committed by Topi Reinio
parent a1b1a30f8a
commit 17bad8be11
2 changed files with 37 additions and 19 deletions

View File

@ -25,15 +25,6 @@ while (i.hasNext())
float f = i.next(); float f = i.next();
//! [6] //! [6]
//! [7]
QSetIterator<QString> i(set);
i.toBack();
while (i.hasPrevious())
QString s = i.previous();
//! [7]
//! [8] //! [8]
QList<float> list; QList<float> list;
... ...

View File

@ -213,12 +213,8 @@
\image javaiterators1.png \image javaiterators1.png
Here's how to iterate over the elements in reverse order:
\snippet code/doc_src_qiterator.cpp 7
If you want to find all occurrences of a particular value, use If you want to find all occurrences of a particular value, use
findNext() or findPrevious() in a loop. findNext() in a loop.
Multiple iterators can be used on the same set. If the set Multiple iterators can be used on the same set. If the set
is modified while a QSetIterator is active, the QSetIterator is modified while a QSetIterator is active, the QSetIterator
@ -389,15 +385,21 @@
*/ */
/*! \fn template <class T> void QListIterator<T>::toBack() /*! \fn template <class T> void QListIterator<T>::toBack()
\fn template <class T> void QSetIterator<T>::toBack()
\fn template <class T> void QMutableListIterator<T>::toBack() \fn template <class T> void QMutableListIterator<T>::toBack()
//! [toBack]
Moves the iterator to the back of the container (after the last Moves the iterator to the back of the container (after the last
item). item).
//! [toBack]
\sa toFront(), previous() \sa toFront(), previous()
*/ */
/*! \fn template <class T> void QSetIterator<T>::toBack()
\include qiterator.qdoc toBack
\sa toFront()
*/
/*! \fn template <class T> void QMutableSetIterator<T>::toBack() /*! \fn template <class T> void QMutableSetIterator<T>::toBack()
Moves the iterator to the back of the container (after the last Moves the iterator to the back of the container (after the last
@ -407,16 +409,22 @@
*/ */
/*! \fn template <class T> bool QListIterator<T>::hasNext() const /*! \fn template <class T> bool QListIterator<T>::hasNext() const
\fn template <class T> bool QSetIterator<T>::hasNext() const
\fn template <class T> bool QMutableListIterator<T>::hasNext() const \fn template <class T> bool QMutableListIterator<T>::hasNext() const
//! [hasNext]
Returns \c true if there is at least one item ahead of the iterator, Returns \c true if there is at least one item ahead of the iterator,
i.e. the iterator is \e not at the back of the container; i.e. the iterator is \e not at the back of the container;
otherwise returns \c false. otherwise returns \c false.
//! [hasNext]
\sa hasPrevious(), next() \sa hasPrevious(), next()
*/ */
/*! \fn template <class T> bool QSetIterator<T>::hasNext() const
\include qiterator.qdoc hasNext
\sa next()
*/
/*! \fn template <class T> bool QMutableSetIterator<T>::hasNext() const /*! \fn template <class T> bool QMutableSetIterator<T>::hasNext() const
Returns \c true if there is at least one item ahead of the iterator, Returns \c true if there is at least one item ahead of the iterator,
@ -427,16 +435,23 @@
*/ */
/*! \fn template <class T> const T &QListIterator<T>::next() /*! \fn template <class T> const T &QListIterator<T>::next()
\fn template <class T> const T &QSetIterator<T>::next()
//! [next]
Returns the next item and advances the iterator by one position. Returns the next item and advances the iterator by one position.
Calling this function on an iterator located at the back of the Calling this function on an iterator located at the back of the
container leads to undefined results. container leads to undefined results.
//! [next]
\sa hasNext(), peekNext(), previous() \sa hasNext(), peekNext(), previous()
*/ */
/*!
\fn template <class T> const T &QSetIterator<T>::next()
\include qiterator.qdoc next
\sa hasNext(), peekNext()
*/
/* \fn template <class T> const T &QMutableSetIterator<T>::next() /* \fn template <class T> const T &QMutableSetIterator<T>::next()
Returns the next item and advances the iterator by one position. Returns the next item and advances the iterator by one position.
@ -468,16 +483,23 @@
*/ */
/*! \fn template <class T> const T &QListIterator<T>::peekNext() const /*! \fn template <class T> const T &QListIterator<T>::peekNext() const
\fn template <class T> const T &QSetIterator<T>::peekNext() const
//! [peekNext]
Returns the next item without moving the iterator. Returns the next item without moving the iterator.
Calling this function on an iterator located at the back of the Calling this function on an iterator located at the back of the
container leads to undefined results. container leads to undefined results.
//! [peekNext]
\sa hasNext(), next(), peekPrevious() \sa hasNext(), next(), peekPrevious()
*/ */
/*!
\fn template <class T> const T &QSetIterator<T>::peekNext() const
\include qiterator.qdoc peekNext
\sa hasNext(), next()
*/
/*! /*!
\fn template <class T> const T &QMutableSetIterator<T>::peekNext() const \fn template <class T> const T &QMutableSetIterator<T>::peekNext() const
@ -563,19 +585,24 @@
*/ */
/*! \fn template <class T> bool QListIterator<T>::findNext(const T &value) /*! \fn template <class T> bool QListIterator<T>::findNext(const T &value)
\fn template <class T> bool QSetIterator<T>::findNext(const T &value)
\fn template <class T> bool QMutableListIterator<T>::findNext(const T &value) \fn template <class T> bool QMutableListIterator<T>::findNext(const T &value)
//! [findNext]
Searches for \a value starting from the current iterator position Searches for \a value starting from the current iterator position
forward. Returns \c true if \a value is found; otherwise returns \c false. forward. Returns \c true if \a value is found; otherwise returns \c false.
After the call, if \a value was found, the iterator is positioned After the call, if \a value was found, the iterator is positioned
just after the matching item; otherwise, the iterator is just after the matching item; otherwise, the iterator is
positioned at the back of the container. positioned at the back of the container.
//! [findNext]
\sa findPrevious() \sa findPrevious()
*/ */
/*! \fn template <class T> bool QSetIterator<T>::findNext(const T &value)
\include qiterator.qdoc findNext
*/
/*! \fn template <class T> bool QListIterator<T>::findPrevious(const T &value) /*! \fn template <class T> bool QListIterator<T>::findPrevious(const T &value)
\fn template <class T> bool QMutableListIterator<T>::findPrevious(const T &value) \fn template <class T> bool QMutableListIterator<T>::findPrevious(const T &value)