diff options
Diffstat (limited to 'src/corelib/tools/qiterator.qdoc')
-rw-r--r-- | src/corelib/tools/qiterator.qdoc | 56 |
1 files changed, 39 insertions, 17 deletions
diff --git a/src/corelib/tools/qiterator.qdoc b/src/corelib/tools/qiterator.qdoc index 3fc68e0874..041fb0701d 100644 --- a/src/corelib/tools/qiterator.qdoc +++ b/src/corelib/tools/qiterator.qdoc @@ -213,12 +213,8 @@ \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 - findNext() or findPrevious() in a loop. + findNext() in a loop. Multiple iterators can be used on the same set. If the set 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 QSetIterator<T>::toBack() \fn template <class T> void QMutableListIterator<T>::toBack() +//! [toBack] Moves the iterator to the back of the container (after the last item). +//! [toBack] \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() 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 QSetIterator<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, i.e. the iterator is \e not at the back of the container; otherwise returns \c false. +//! [hasNext] \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 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 &QSetIterator<T>::next() +//! [next] Returns the next item and advances the iterator by one position. Calling this function on an iterator located at the back of the container leads to undefined results. +//! [next] \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() Returns the next item and advances the iterator by one position. @@ -468,17 +483,24 @@ */ /*! \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. Calling this function on an iterator located at the back of the container leads to undefined results. +//! [peekNext] \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 Returns the next item without moving the iterator. @@ -500,7 +522,6 @@ */ /*! \fn template <class T> bool QListIterator<T>::hasPrevious() const - \fn template <class T> bool QSetIterator<T>::hasPrevious() const \fn template <class T> bool QMutableListIterator<T>::hasPrevious() const Returns \c true if there is at least one item behind the iterator, @@ -511,7 +532,6 @@ */ /*! \fn template <class T> const T &QListIterator<T>::previous() - \fn template <class T> const T &QSetIterator<T>::previous() Returns the previous item and moves the iterator back by one position. @@ -534,7 +554,6 @@ */ /*! \fn template <class T> const T &QListIterator<T>::peekPrevious() const - \fn template <class T> const T &QSetIterator<T>::peekPrevious() const Returns the previous item without moving the iterator. @@ -566,21 +585,25 @@ */ /*! \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) +//! [findNext] Searches for \a value starting from the current iterator position 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 just after the matching item; otherwise, the iterator is positioned at the back of the container. +//! [findNext] \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 QSetIterator<T>::findPrevious(const T &value) \fn template <class T> bool QMutableListIterator<T>::findPrevious(const T &value) Searches for \a value starting from the current iterator position @@ -950,9 +973,8 @@ be preferred. QMutableHashIterator\<Key, T\> allows you to iterate over a QHash - (or a QMultiHash) and modify the hash. If you don't want to modify - the hash (or have a const QHash), use the slightly faster - QHashIterator instead. + and modify the hash. If you don't want to modify the hash (or have + a const QHash), use the slightly faster QHashIterator instead. The QMutableHashIterator constructor takes a QHash as argument. After construction, the iterator is located at the very beginning |