Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qiterator.qdoc
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*! \class QKeyValueIterator
5 \inmodule QtCore
6 \since 5.10
7
8 \brief Iterator over the key/value pairs of an associative container.
9
10 The QKeyValueIterator class provides an STL-style iterator for returning
11 key/value pairs from associative containers like QHash and QMap. The
12 template parameter \a Key specifies the key type, \a T specifies the value
13 type, \a Iterator is the underlying iterator type, and \a Traits specifies
14 the iterator traits. It supports the same API as the STL associative
15 containers, i.e. getting a key/value pair when iterating through the
16 container.
17
18 This will allow for better interoperability between QMap, QHash and friends
19 and STL-style algorithms.
20
21 \warning Iterators on implicitly shared containers do not work
22 exactly like STL-iterators. You should avoid copying a container
23 while iterators are active on that container. For more information,
24 read \l{Implicit sharing iterator problem}.
25*/
26
27/*! \typedef QKeyValueIterator::iterator_category
28 \internal
29*/
30
31/*! \typedef QKeyValueIterator::difference_type
32 \internal
33*/
34
35/*! \typedef QKeyValueIterator::value_type
36 \internal
37*/
38
39/*! \struct QKeyValueIterator::pointer
40 \internal
41*/
42
43/*! \typedef QKeyValueIterator::reference
44 \internal
45*/
46
47/*! \fn template<typename Key, typename T, class Iterator, class Traits> QKeyValueIterator<Key, T, Iterator, Traits>::QKeyValueIterator()
48
49 Constructs a default QKeyValueIterator.
50*/
51
52/*! \fn template<typename Key, typename T, class Iterator, class Traits> QKeyValueIterator<Key, T, Iterator, Traits>::QKeyValueIterator(Iterator o)
53
54 Constructs a QKeyValueIterator on top of \a o.
55*/
56
57/*! \fn template<typename Key, typename T, class Iterator, class Traits> std::pair<Key, T> QKeyValueIterator<Key, T, Iterator, Traits>::operator*() const
58
59 Returns the current entry as a pair.
60*/
61
62/*! \fn template<typename Key, typename T, class Iterator, class Traits> pointer QKeyValueIterator<Key, T, Iterator,Traits>::operator->() const
63
64 Returns the current entry as a pointer-like object to the pair.
65
66 \since 5.15
67
68 \sa operator*()
69*/
70
71/*! \fn template<typename Key, typename T, class Iterator, class Traits> bool QKeyValueIterator<Key, T, Iterator, Traits>::operator==(QKeyValueIterator<Key, T, Iterator, Traits> lhs, QKeyValueIterator<Key, T, Iterator, Traits> rhs)
72
73 Returns \c true if \a rhs points to the same item as \a lhs otherwise returns
74 \c false.
75
76 \sa operator!=()
77*/
78
79/*! \fn template<typename Key, typename T, class Iterator, class Traits> bool QKeyValueIterator<Key, T, Iterator, Traits>::operator!=(QKeyValueIterator<Key, T, Iterator, Traits> lhs, QKeyValueIterator<Key, T, Iterator, Traits> rhs)
80
81 Returns \c true if \a rhs points to a different item than \a lhs otherwise
82 returns \c false.
83
84 \sa operator==()
85*/
86
87/*!
88 \fn template<typename Key, typename T, class Iterator, class Traits> QKeyValueIterator &QKeyValueIterator<Key, T, Iterator, Traits>::operator++()
89
90 The prefix \c{++} operator (\c{++i}) advances the iterator to the
91 next item in the container and returns the iterator.
92
93 \note Advancing the iterator past its container's \l{iterator-end}{end()} constitutes
94 undefined behavior.
95
96 \sa operator--()
97*/
98
99/*! \fn template<typename Key, typename T, class Iterator, class Traits> QKeyValueIterator QKeyValueIterator<Key, T, Iterator, Traits>::operator++(int)
100
101 \overload
102
103 The postfix \c{++} operator (\c{i++}) advances the iterator to the
104 next item in the container and returns the iterator's prior value.
105
106 \note Advancing the iterator past its container's \l{iterator-end}{end()} constitutes
107 undefined behavior.
108*/
109
110/*! \fn template<typename Key, typename T, class Iterator, class Traits> QKeyValueIterator &QKeyValueIterator<Key, T, Iterator, Traits>::operator--()
111
112 The prefix c{--} operator (\c{--i}) backs the iterator up to the previous item
113 in the container and returns the iterator.
114
115 \note Backing up an iterator to before its container's \l{iterator-begin}{begin()} constitutes
116 undefined behavior.
117
118 \sa operator++()
119*/
120
121/*! \fn template<typename Key, typename T, class Iterator, class Traits> QKeyValueIterator QKeyValueIterator<Key, T, Iterator, Traits>::operator--(int)
122
123 \overload
124
125 The postfix c{--} operator (\c{i--}) backs the iterator up to the previous item
126 in the container and returns the iterator's prior value.
127
128 \note Backing up an iterator to before its container's \l{iterator-begin}{begin()} constitutes
129 undefined behavior.
130*/
131
132/*! \fn template<typename Key, typename T, class Iterator, class Traits> Iterator QKeyValueIterator<Key, T, Iterator, Traits>::base() const
133 Returns the underlying iterator this QKeyValueIterator is based on.
134*/
135
136/*!
137 \class QListIterator
138 \inmodule QtCore
139 \ingroup java-style-iterators
140
141 \brief The QListIterator class provides a Java-style const iterator for QList and QQueue.
142
143 QList has both \l{Java-style iterators} and \l{STL-style
144 iterators}. STL-style iterators are more efficient and should
145 be preferred. The template parameter \a T specifies the type of
146 the items stored in the list.
147
148 An alternative to using iterators is to use index positions. Most
149 QList member functions take an index as their first parameter,
150 making it possible to access, modify, and remove items without
151 using iterators.
152
153 QListIterator<T> allows you to iterate over a QList<T>,
154 a QQueue<T> or a QStack<T>. If you want to modify the list
155 as you iterate over it, use QMutableListIterator<T> instead.
156
157 The QListIterator constructor takes a QList as argument. After
158 construction, the iterator is located at the very beginning of
159 the list (before the first item). Here's how to iterate over all
160 the elements sequentially:
161
162 \snippet code/doc_src_qiterator.cpp 0
163
164 The next() function returns the next item in the list and
165 advances the iterator. Unlike STL-style iterators, Java-style
166 iterators point \e between items rather than directly \e at
167 items. The first call to next() advances the iterator to the
168 position between the first and second item, and returns the first
169 item; the second call to next() advances the iterator to the
170 position between the second and third item, and returns the second
171 item; and so on.
172
173 \image javaiterators1.svg {Iterator positions between items A, B, C, D}
174
175 Here's how to iterate over the elements in reverse order:
176
177 \snippet code/doc_src_qiterator.cpp 1
178
179 If you want to find all occurrences of a particular value, use
180 findNext() or findPrevious() in a loop.
181
182 Multiple iterators can be used on the same list. If the list is
183 modified while a QListIterator is active, the QListIterator will
184 continue iterating over the original list, ignoring the modified
185 copy.
186
187 \sa QMutableListIterator, QList::const_iterator
188*/
189
190/*!
191 \class QSetIterator
192 \inmodule QtCore
193 \ingroup java-style-iterators
194 \brief The QSetIterator class provides a Java-style const iterator for QSet.
195
196 QSet has both \l{Java-style iterators} and \l{STL-style
197 iterators}. STL-style iterators are more efficient and should
198 be preferred. The template parameter \a T specifies the type of
199 the items stored in the set.
200
201 QSetIterator<T> allows you to iterate over a QSet<T>. If you
202 want to modify the set as you iterate over it, use
203 QMutableSetIterator<T> instead.
204
205 The constructor takes a QSet as argument. After construction, the
206 iterator is located at the very beginning of the set (before
207 the first item). Here's how to iterate over all the elements
208 sequentially:
209
210 \snippet code/doc_src_qiterator.cpp 6
211
212 The next() function returns the next item in the set and
213 advances the iterator. Unlike STL-style iterators, Java-style
214 iterators point \e between items rather than directly \e at
215 items. The first call to next() advances the iterator to the
216 position between the first and second item, and returns the first
217 item; the second call to next() advances the iterator to the
218 position between the second and third item, returning the second
219 item; and so on.
220
221 \image javaiterators1.svg {Iterator positions between items A, B, C, D}
222
223 If you want to find all occurrences of a particular value, use
224 findNext() in a loop.
225
226 Multiple iterators can be used on the same set. If the set
227 is modified while a QSetIterator is active, the QSetIterator
228 will continue iterating over the original set, ignoring the
229 modified copy.
230
231 \sa QMutableSetIterator, QSet::const_iterator
232*/
233
234/*!
235 \class QMutableListIterator
236 \inmodule QtCore
237
238 \brief The QMutableListIterator class provides a Java-style non-const iterator for QList, QQueue and QStack.
239
240 QList has both \l{Java-style iterators} and \l{STL-style
241 iterators}. STL-style iterators are more efficient and should
242 be preferred. The template parameter \a T specifies the type of
243 the items stored in the list.
244
245 An alternative to using iterators is to use index positions. Most
246 QList member functions take an index as their first parameter,
247 making it possible to access, insert, and remove items without
248 using iterators.
249
250 QMutableListIterator<T> allows you to iterate over a QList<T>
251 (or a QQueue<T>) and modify the list. If you don't want to
252 modify the list (or have a const QList), use the slightly faster
253 QListIterator<T> instead.
254
255 The QMutableListIterator constructor takes a QList as argument.
256 After construction, the iterator is located at the very beginning
257 of the list (before the first item). Here's how to iterate over
258 all the elements sequentially:
259
260 \snippet code/doc_src_qiterator.cpp 8
261
262 The next() function returns the next item in the list and
263 advances the iterator. Unlike STL-style iterators, Java-style
264 iterators point \e between items rather than directly \e at
265 items. The first call to next() advances the iterator to the
266 position between the first and second item, and returns the first
267 item; the second call to next() advances the iterator to the
268 position between the second and third item, returning the second
269 item; and so on.
270
271 \image javaiterators1.svg {Iterator positions between items A, B, C, D}
272
273 Here's how to iterate over the elements in reverse order:
274
275 \snippet code/doc_src_qiterator.cpp 9
276
277 If you want to find all occurrences of a particular value, use
278 findNext() or findPrevious() in a loop.
279
280 If you want to remove items as you iterate over the list, use
281 remove(). If you want to modify the value of an item, use
282 setValue(). If you want to insert a new item in the list, use
283 insert().
284
285 Example:
286 \snippet code/doc_src_qiterator.cpp 10
287
288 The example traverses a list, replacing negative numbers with
289 their absolute values, and eliminating zeroes.
290
291 Only one mutable iterator can be active on a given list at any
292 time. Furthermore, no changes should be done directly to the list
293 while the iterator is active (as opposed to through the
294 iterator), since this could invalidate the iterator and lead to
295 undefined behavior.
296
297 \sa QListIterator, QList::iterator
298*/
299
300/*!
301 \class QMutableSetIterator
302 \inmodule QtCore
303 \ingroup java-style-iterators
304 \since 4.2
305
306 \brief The QMutableSetIterator class provides a Java-style non-const iterator for QSet.
307
308 QSet has both \l{Java-style iterators} and \l{STL-style
309 iterators}. STL-style iterators are more efficient and should
310 be preferred. The template parameter \a T specifies the type of
311 the items stored in the set.
312
313 QMutableSetIterator<T> allows you to iterate over a QSet<T>
314 and remove items from the set as you iterate. If you don't want
315 to modify the set (or have a const QSet), use the slightly faster
316 QSetIterator<T> instead.
317
318 The QMutableSetIterator constructor takes a QSet as argument.
319 After construction, the iterator is located at the very beginning
320 of the set (before the first item). Here's how to iterate over
321 all the elements sequentially:
322
323 \snippet code/doc_src_qiterator.cpp 17
324
325 The next() function returns the next item in the set and
326 advances the iterator. Unlike STL-style iterators, Java-style
327 iterators point \e between items rather than directly \e at
328 items. The first call to next() advances the iterator to the
329 position between the first and second item, and returns the first
330 item; the second call to next() advances the iterator to the
331 position between the second and third item, returning the second
332 item; and so on.
333
334 \image javaiterators1.svg {Iterator positions between items A, B, C, D}
335
336 If you want to remove items as you iterate over the set, use
337 remove().
338
339 Only one mutable iterator can be active on a given set at any
340 time. Furthermore, no changes should be done directly to the set
341 while the iterator is active (as opposed to through the
342 iterator), since this could invalidate the iterator and lead to
343 undefined behavior.
344
345 \sa QSetIterator, QSet::iterator
346*/
347
348/*!
349 \fn template <class T> QListIterator<T>::QListIterator(const QList<T> &list)
350 \fn template <class T> QMutableListIterator<T>::QMutableListIterator(QList<T> &list)
351
352 Constructs an iterator for traversing \a list. The iterator is
353 set to be at the front of the list (before the first item).
354
355 \sa operator=()
356*/
357
358/*!
359 \fn template <class T> QSetIterator<T>::QSetIterator(const QSet<T> &set)
360 \fn template <class T> QMutableSetIterator<T>::QMutableSetIterator(QSet<T> &set)
361
362 Constructs an iterator for traversing \a set. The iterator is
363 set to be at the front of the set (before the first item).
364
365 \sa operator=()
366*/
367
368/*! \fn template <class T> QMutableListIterator &QMutableListIterator<T>::operator=(QList<T> &list)
369 \fn template <class T> QListIterator &QListIterator<T>::operator=(const QList<T> &list)
370
371 Makes the iterator operate on \a list. The iterator is set to be
372 at the front of the list (before the first item).
373
374 \sa toFront(), toBack()
375*/
376
377/*! \fn template <class T> QSetIterator &QSetIterator<T>::operator=(const QSet<T> &set)
378 \fn template <class T> QMutableSetIterator &QMutableSetIterator<T>::operator=(QSet<T> &set)
379
380 Makes the iterator operate on \a set. The iterator is set to be
381 at the front of the set (before the first item).
382
383 \sa toFront(), toBack()
384*/
385
386/*! \fn template <class T> void QListIterator<T>::toFront()
387 \fn template <class T> void QSetIterator<T>::toFront()
388 \fn template <class T> void QMutableListIterator<T>::toFront()
389 \fn template <class T> void QMutableSetIterator<T>::toFront()
390
391 Moves the iterator to the front of the container (before the
392 first item).
393
394 \sa toBack(), next()
395*/
396
397/*! \fn template <class T> void QListIterator<T>::toBack()
398 \fn template <class T> void QMutableListIterator<T>::toBack()
399
400//! [toBack]
401 Moves the iterator to the back of the container (after the last
402 item).
403//! [toBack]
404
405 \sa toFront(), previous()
406*/
407
408/*! \fn template <class T> void QSetIterator<T>::toBack()
409 \include qiterator.qdoc toBack
410 \sa toFront()
411*/
412
413/*! \fn template <class T> void QMutableSetIterator<T>::toBack()
414
415 Moves the iterator to the back of the container (after the last
416 item).
417
418 \sa toFront()
419*/
420
421/*! \fn template <class T> bool QListIterator<T>::hasNext() const
422 \fn template <class T> bool QMutableListIterator<T>::hasNext() const
423
424//! [hasNext]
425 Returns \c true if there is at least one item ahead of the iterator,
426 i.e. the iterator is \e not at the back of the container;
427 otherwise returns \c false.
428//! [hasNext]
429
430 \sa hasPrevious(), next()
431*/
432
433/*! \fn template <class T> bool QSetIterator<T>::hasNext() const
434 \include qiterator.qdoc hasNext
435 \sa next()
436*/
437
438/*! \fn template <class T> bool QMutableSetIterator<T>::hasNext() const
439
440 Returns \c true if there is at least one item ahead of the iterator,
441 i.e. the iterator is \e not at the back of the container;
442 otherwise returns \c false.
443
444 \sa next()
445*/
446
447/*! \fn template <class T> const T &QListIterator<T>::next()
448
449//! [next]
450 Returns the next item and advances the iterator by one position.
451
452 Calling this function on an iterator located at the back of the
453 container leads to undefined results.
454//! [next]
455
456 \sa hasNext(), peekNext(), previous()
457*/
458
459/*!
460 \fn template <class T> const T &QSetIterator<T>::next()
461 \include qiterator.qdoc next
462 \sa hasNext(), peekNext()
463*/
464
465/* \fn template <class T> const T &QMutableSetIterator<T>::next()
466 Returns the next item and advances the iterator by one position.
467
468 Calling this function on an iterator located at the back of the
469 container leads to undefined results.
470
471 \sa hasNext(), peekNext()
472*/
473
474/*! \fn template <class T> const T &QMutableSetIterator<T>::next()
475
476 Returns the next item and advances the iterator by one position.
477
478 Calling this function on an iterator located at the back of the
479 container leads to undefined results.
480
481 \sa hasNext(), peekNext()
482*/
483
484/*! \fn template <class T> T &QMutableListIterator<T>::next()
485
486 Returns a reference to the next item, and advances the iterator
487 by one position.
488
489 Calling this function on an iterator located at the back of the
490 container leads to undefined results.
491
492 \sa hasNext(), peekNext(), previous()
493*/
494
495/*! \fn template <class T> const T &QListIterator<T>::peekNext() const
496
497//! [peekNext]
498 Returns the next item without moving the iterator.
499
500 Calling this function on an iterator located at the back of the
501 container leads to undefined results.
502//! [peekNext]
503
504 \sa hasNext(), next(), peekPrevious()
505*/
506
507/*!
508 \fn template <class T> const T &QSetIterator<T>::peekNext() const
509 \include qiterator.qdoc peekNext
510 \sa hasNext(), next()
511*/
512
513/*!
514 \fn template <class T> const T &QMutableSetIterator<T>::peekNext() const
515
516 Returns the next item without moving the iterator.
517
518 Calling this function on an iterator located at the back of the
519 container leads to undefined results.
520
521 \sa hasNext(), next()
522*/
523
524/*! \fn template <class T> T &QMutableListIterator<T>::peekNext() const
525
526 Returns a reference to the next item, without moving the iterator.
527
528 Calling this function on an iterator located at the back of the
529 container leads to undefined results.
530
531 \sa hasNext(), next(), peekPrevious()
532*/
533
534/*! \fn template <class T> bool QListIterator<T>::hasPrevious() const
535 \fn template <class T> bool QMutableListIterator<T>::hasPrevious() const
536
537 Returns \c true if there is at least one item behind the iterator,
538 i.e. the iterator is \e not at the front of the container;
539 otherwise returns \c false.
540
541 \sa hasNext(), previous()
542*/
543
544/*! \fn template <class T> const T &QListIterator<T>::previous()
545
546 Returns the previous item and moves the iterator back by one
547 position.
548
549 Calling this function on an iterator located at the front of the
550 container leads to undefined results.
551
552 \sa hasPrevious(), peekPrevious(), next()
553*/
554
555/*! \fn template <class T> T &QMutableListIterator<T>::previous()
556
557 Returns a reference to the previous item and moves the iterator
558 back by one position.
559
560 Calling this function on an iterator located at the front of the
561 container leads to undefined results.
562
563 \sa hasPrevious(), peekPrevious(), next()
564*/
565
566/*! \fn template <class T> const T &QListIterator<T>::peekPrevious() const
567
568 Returns the previous item without moving the iterator.
569
570 Calling this function on an iterator located at the front of the
571 container leads to undefined results.
572
573 \sa hasPrevious(), previous(), peekNext()
574*/
575
576/*! \fn template <class T> T &QMutableListIterator<T>::peekPrevious() const
577
578 Returns a reference to the previous item, without moving the iterator.
579
580 Calling this function on an iterator located at the front of the
581 container leads to undefined results.
582
583 \sa hasPrevious(), previous(), peekNext()
584*/
585
586/*!
587 \fn template <class T> bool QMutableSetIterator<T>::findNext(const T &value)
588
589 Searches for \a value starting from the current iterator position
590 forward. Returns \c true if \a value is found; otherwise returns \c false.
591
592 After the call, if \a value was found, the iterator is positioned
593 just after the matching item; otherwise, the iterator is
594 positioned at the back of the container.
595*/
596
597/*! \fn template <class T> bool QListIterator<T>::findNext(const T &value)
598 \fn template <class T> bool QMutableListIterator<T>::findNext(const T &value)
599
600//! [findNext]
601 Searches for \a value starting from the current iterator position
602 forward. Returns \c true if \a value is found; otherwise returns \c false.
603
604 After the call, if \a value was found, the iterator is positioned
605 just after the matching item; otherwise, the iterator is
606 positioned at the back of the container.
607//! [findNext]
608
609 \sa findPrevious()
610*/
611
612/*! \fn template <class T> bool QSetIterator<T>::findNext(const T &value)
613 \include qiterator.qdoc findNext
614*/
615
616/*! \fn template <class T> bool QListIterator<T>::findPrevious(const T &value)
617 \fn template <class T> bool QMutableListIterator<T>::findPrevious(const T &value)
618
619 Searches for \a value starting from the current iterator position
620 backward. Returns \c true if \a value is found; otherwise returns
621 false.
622
623 After the call, if \a value was found, the iterator is positioned
624 just before the matching item; otherwise, the iterator is
625 positioned at the front of the container.
626
627 \sa findNext()
628*/
629
630/*! \fn template <class T> void QMutableListIterator<T>::remove()
631
632 Removes the last item that was jumped over using one of the
633 traversal functions (next(), previous(), findNext(), findPrevious()).
634
635 Example:
636 \snippet code/doc_src_qiterator.cpp 19
637
638 \sa insert(), setValue()
639*/
640
641/*! \fn template <class T> void QMutableSetIterator<T>::remove()
642
643 Removes the last item that was jumped over using one of the
644 traversal functions (next(), findNext()).
645
646 Example:
647 \snippet code/doc_src_qiterator.cpp 22
648
649 \sa value()
650*/
651
652/*! \fn template <class T> void QMutableListIterator<T>::setValue(const T &value) const
653
654 Replaces the value of the last item that was jumped over using
655 one of the traversal functions with \a value.
656
657 The traversal functions are next(), previous(), findNext(), and
658 findPrevious().
659
660 Example:
661 \snippet code/doc_src_qiterator.cpp 23
662
663 \sa value(), remove(), insert()
664*/
665
666/*! \fn template <class T> const T &QMutableListIterator<T>::value() const
667
668 Returns the value of the last item that was jumped over using one
669 of the traversal functions (next(), previous(), findNext(),
670 findPrevious()).
671
672 After a call to next() or findNext(), value() is equivalent to
673 peekPrevious(). After a call to previous() or findPrevious(), value() is
674 equivalent to peekNext().
675*/
676
677/*! \fn template <class T> const T &QMutableSetIterator<T>::value() const
678
679 Returns the value of the last item that was jumped over using
680 next() or findNext().
681*/
682
683/*!
684 \fn template <class T> T &QMutableListIterator<T>::value()
685 \overload
686
687 Returns a non-const reference to the value of the last item that
688 was jumped over using one of the traversal functions.
689*/
690
691/*! \fn template <class T> void QMutableListIterator<T>::insert(const T &value)
692
693 Inserts \a value at the current iterator position. After the
694 call, the iterator is located just after the inserted item.
695
696 \sa remove(), setValue()
697*/
698
699/*!
700 \class QMapIterator
701 \inmodule QtCore
702 \ingroup java-style-iterators
703
704 \brief The QMapIterator class provides a Java-style const iterator for QMap.
705
706 QMap has both \l{Java-style iterators} and \l{STL-style
707 iterators}. STL-style iterators are more efficient and should
708 be preferred. The template parameter \a Key specifies the map's
709 key type, and \a T specifies the value type.
710
711 QMapIterator<Key, T> allows you to iterate over a QMap.
712 If you want to modify the map as you iterate over
713 it, use QMutableMapIterator instead.
714
715 The QMapIterator constructor takes a QMap as argument. After
716 construction, the iterator is located at the very beginning of
717 the map (before the first item). Here's how to iterate over all
718 the elements sequentially:
719
720 \snippet code/doc_src_qiterator.cpp 26
721
722 The next() function returns the next item in the map and
723 advances the iterator. The key() and value() functions return the
724 key and value of the last item that was jumped over.
725
726 Unlike STL-style iterators, Java-style iterators point \e between
727 items rather than directly \e at items. The first call to next()
728 advances the iterator to the position between the first and
729 second item, and returns the first item; the second call to
730 next() advances the iterator to the position between the second
731 and third item; and so on.
732
733 \image javaiterators1.svg {Iterator positions between items A, B, C, D}
734
735 Here's how to iterate over the elements in reverse order:
736
737 \snippet code/doc_src_qiterator.cpp 27
738
739 If you want to find all occurrences of a particular value, use
740 findNext() or findPrevious() in a loop. For example:
741
742 \snippet code/doc_src_qiterator.cpp 28
743
744 Multiple iterators can be used on the same map. If the map is
745 modified while a QMapIterator is active, the QMapIterator will
746 continue iterating over the original map, ignoring the modified
747 copy.
748
749 \sa QMutableMapIterator, QMap::const_iterator
750*/
751
752/*!
753 \class QMultiMapIterator
754 \inmodule QtCore
755 \ingroup java-style-iterators
756
757 \brief The QMultiMapIterator class provides a Java-style const iterator for QMultiMap.
758 QMultiMap has both \l{Java-style iterators} and \l{STL-style
759 iterators}. STL-style iterators are more efficient and should
760 be preferred. The template parameter \a Key specifies the map's
761 key type, and \a T specifies the value type.
762
763 QMultiMapIterator<Key, T> allows you to iterate over a QMultiMap.
764 If you want to modify the map as you iterate over
765 it, use QMutableMultiMapIterator instead.
766
767 The QMultiMapIterator constructor takes a QMultiMap as argument. After
768 construction, the iterator is located at the very beginning of
769 the map (before the first item). Here's how to iterate over all
770 the elements sequentially:
771
772 \snippet code/doc_src_qiterator.cpp 26multi
773
774 The next() function returns the next item in the map and
775 advances the iterator. The key() and value() functions return the
776 key and value of the last item that was jumped over.
777
778 Unlike STL-style iterators, Java-style iterators point \e between
779 items rather than directly \e at items. The first call to next()
780 advances the iterator to the position between the first and
781 second item, and returns the first item; the second call to
782 next() advances the iterator to the position between the second
783 and third item; and so on.
784
785 \image javaiterators1.svg {Iterator positions between items A, B, C, D}
786
787 Here's how to iterate over the elements in reverse order:
788
789 \snippet code/doc_src_qiterator.cpp 27multi
790
791 If you want to find all occurrences of a particular value, use
792 findNext() or findPrevious() in a loop. For example:
793
794 \snippet code/doc_src_qiterator.cpp 28multi
795
796 Multiple iterators can be used on the same map. If the map is
797 modified while a QMultiMapIterator is active, the QMultiMapIterator will
798 continue iterating over the original map, ignoring the modified
799 copy.
800
801 \sa QMutableMultiMapIterator
802*/
803
804/*!
805 \class QHashIterator
806 \inmodule QtCore
807 \ingroup java-style-iterators
808
809 \brief The QHashIterator class provides a Java-style const iterator for QHash and QMultiHash.
810
811 QHash has both \l{Java-style iterators} and \l{STL-style
812 iterators}. STL-style iterators are more efficient and should
813 be preferred. The template parameter \a Key specifies the hash's
814 key type, and \a T specifies the value type.
815
816 QHashIterator<Key, T> allows you to iterate over a QHash (or a
817 QMultiHash). If you want to modify the hash as you iterate over
818 it, use QMutableHashIterator instead.
819
820 The QHashIterator constructor takes a QHash as argument. After
821 construction, the iterator is located at the very beginning of
822 the hash (before the first item). Here's how to iterate over all
823 the elements sequentially:
824
825 \snippet code/doc_src_qiterator.cpp 29
826
827 The next() function returns the next item in the hash and
828 advances the iterator. The key() and value() functions return the
829 key and value of the last item that was jumped over.
830
831 Unlike STL-style iterators, Java-style iterators point \e between
832 items rather than directly \e at items. The first call to next()
833 advances the iterator to the position between the first and
834 second item, and returns the first item; the second call to
835 next() advances the iterator to the position between the second
836 and third item; and so on.
837
838 \image javaiterators1.svg {Iterator positions between items A, B, C, D}
839
840 If you want to find all occurrences of a particular value, use
841 findNext() in a loop. For example:
842
843 \snippet code/doc_src_qiterator.cpp 31
844
845 Multiple iterators can be used on the same hash. If the hash is
846 modified while a QHashIterator is active, the QHashIterator will
847 continue iterating over the original hash, ignoring the modified
848 copy.
849
850 \sa QMutableHashIterator, QHash::const_iterator
851*/
852
853/*!
854 \class QMutableMapIterator
855 \inmodule QtCore
856 \ingroup java-style-iterators
857
858 \brief The QMutableMapIterator class provides a Java-style non-const iterator for QMap.
859
860 QMap has both \l{Java-style iterators} and \l{STL-style
861 iterators}. STL-style iterators are more efficient and should
862 be preferred. The template parameter \a Key specifies the map's
863 key type, and \a T specifies the value type.
864
865 QMutableMapIterator<Key, T> allows you to iterate over a QMap
866 and modify the map. If you don't want to modify
867 the map (or have a const QMap), use the slightly faster
868 QMapIterator instead.
869
870 The QMutableMapIterator constructor takes a QMap as argument.
871 After construction, the iterator is located at the very beginning
872 of the map (before the first item). Here's how to iterate over
873 all the elements sequentially:
874
875 \snippet code/doc_src_qiterator.cpp 32
876
877 The next() function returns the next item in the map and
878 advances the iterator. The key() and value() functions return the
879 key and value of the last item that was jumped over.
880
881 Unlike STL-style iterators, Java-style iterators point \e between
882 items rather than directly \e at items. The first call to next()
883 advances the iterator to the position between the first and
884 second item, and returns the first item; the second call to
885 next() advances the iterator to the position between the second
886 and third item; and so on.
887
888 \image javaiterators1.svg {Iterator positions between items A, B, C, D}
889
890 Here's how to iterate over the elements in reverse order:
891
892 \snippet code/doc_src_qiterator.cpp 33
893
894 If you want to find all occurrences of a particular value, use
895 findNext() or findPrevious() in a loop. For example:
896
897 \snippet code/doc_src_qiterator.cpp 34
898
899 If you want to remove items as you iterate over the map, use
900 remove(). If you want to modify the value of an item, use
901 setValue().
902
903 Example:
904
905 \snippet code/doc_src_qiterator.cpp 35
906
907 The example removes all (key, value) pairs where the key and the
908 value are the same.
909
910 Only one mutable iterator can be active on a given map at any
911 time. Furthermore, no changes should be done directly to the map
912 while the iterator is active (as opposed to through the
913 iterator), since this could invalidate the iterator and lead to
914 undefined behavior.
915
916 \sa QMapIterator, QMap::iterator
917*/
918
919/*!
920 \class QMutableMultiMapIterator
921 \inmodule QtCore
922
923 \brief The QMutableMultiMapIterator class provides a Java-style non-const iterator for QMultiMap.
924
925 QMultiMap has both \l{Java-style iterators} and \l{STL-style
926 iterators}. STL-style iterators are more efficient and should
927 be preferred. The template parameter \a Key specifies the map's
928 key type, and \a T specifies the value type.
929
930 QMutableMultiMapIterator<Key, T> allows you to iterate over a QMultiMap
931 and modify the map. If you don't want to modify
932 the map (or have a const QMultiMap), use the slightly faster
933 QMultiMapIterator instead.
934
935 The QMutableMultiMapIterator constructor takes a QMultiMap as argument.
936 After construction, the iterator is located at the very beginning
937 of the map (before the first item). Here's how to iterate over
938 all the elements sequentially:
939
940 \snippet code/doc_src_qiterator.cpp 32multi
941
942 The next() function returns the next item in the map and
943 advances the iterator. The key() and value() functions return the
944 key and value of the last item that was jumped over.
945
946 Unlike STL-style iterators, Java-style iterators point \e between
947 items rather than directly \e at items. The first call to next()
948 advances the iterator to the position between the first and
949 second item, and returns the first item; the second call to
950 next() advances the iterator to the position between the second
951 and third item; and so on.
952
953 \image javaiterators1.svg {Iterator positions between items A, B, C, D}
954
955 Here's how to iterate over the elements in reverse order:
956
957 \snippet code/doc_src_qiterator.cpp 33multi
958
959 If you want to find all occurrences of a particular value, use
960 findNext() or findPrevious() in a loop. For example:
961
962 \snippet code/doc_src_qiterator.cpp 34multi
963
964 If you want to remove items as you iterate over the map, use
965 remove(). If you want to modify the value of an item, use
966 setValue().
967
968 Example:
969
970 \snippet code/doc_src_qiterator.cpp 35multi
971
972 The example removes all (key, value) pairs where the key and the
973 value are the same.
974
975 Only one mutable iterator can be active on a given map at any
976 time. Furthermore, no changes should be done directly to the map
977 while the iterator is active (as opposed to through the
978 iterator), since this could invalidate the iterator and lead to
979 undefined behavior.
980
981 \sa QMultiMapIterator, QMultiMap::iterator
982*/
983
984/*!
985 \class QMutableHashIterator
986 \inmodule QtCore
987 \ingroup java-style-iterators
988
989 \brief The QMutableHashIterator class provides a Java-style non-const iterator for QHash and QMultiHash.
990
991 QHash has both \l{Java-style iterators} and \l{STL-style
992 iterators}. STL-style iterators are more efficient and should
993 be preferred. The template parameter \a Key specifies the hash's
994 key type, and \a T specifies the value type.
995
996 QMutableHashIterator<Key, T> allows you to iterate over a QHash
997 and modify the hash. If you don't want to modify the hash (or have
998 a const QHash), use the slightly faster QHashIterator instead.
999
1000 The QMutableHashIterator constructor takes a QHash as argument.
1001 After construction, the iterator is located at the very beginning
1002 of the hash (before the first item). Here's how to iterate over
1003 all the elements sequentially:
1004
1005 \snippet code/doc_src_qiterator.cpp 36
1006
1007 The next() function returns the next item in the hash and
1008 advances the iterator. The key() and value() functions return the
1009 key and value of the last item that was jumped over.
1010
1011 Unlike STL-style iterators, Java-style iterators point \e between
1012 items rather than directly \e at items. The first call to next()
1013 advances the iterator to the position between the first and
1014 second item, and returns the first item; the second call to
1015 next() advances the iterator to the position between the second
1016 and third item; and so on.
1017
1018 \image javaiterators1.svg {Iterator positions between items A, B, C, D}
1019
1020 If you want to find all occurrences of a particular value, use
1021 findNext() in a loop. For example:
1022
1023 \snippet code/doc_src_qiterator.cpp 38
1024
1025 If you want to remove items as you iterate over the hash, use
1026 remove(). If you want to modify the value of an item, use
1027 setValue().
1028
1029 Example:
1030
1031 \snippet code/doc_src_qiterator.cpp 39
1032
1033 The example removes all (key, value) pairs where the key and the
1034 value are the same.
1035
1036 Only one mutable iterator can be active on a given hash at any
1037 time. Furthermore, no changes should be done directly to the hash
1038 while the iterator is active (as opposed to through the
1039 iterator), since this could invalidate the iterator and lead to
1040 undefined behavior.
1041
1042 \sa QHashIterator, QHash::iterator
1043*/
1044
1045/*! \fn template <class Key, class T> QMapIterator<Key, T>::QMapIterator(const QMap<Key, T> &map)
1046 \fn template <class Key, class T> QMutableMapIterator<Key, T>::QMutableMapIterator(QMap<Key, T> &map)
1047 \fn template <class Key, class T> QMultiMapIterator<Key, T>::QMultiMapIterator(const QMultiMap<Key, T> &map)
1048 \fn template <class Key, class T> QMutableMultiMapIterator<Key, T>::QMutableMultiMapIterator(QMultiMap<Key, T> &map)
1049
1050 Constructs an iterator for traversing \a map. The iterator is set
1051 to be at the front of the map (before the first item).
1052
1053 \sa operator=()
1054*/
1055
1056/*! \fn template <class Key, class T> QHashIterator<Key, T>::QHashIterator(const QHash<Key, T> &hash)
1057 \fn template <class Key, class T> QMutableHashIterator<Key, T>::QMutableHashIterator(QHash<Key, T> &hash)
1058
1059 Constructs an iterator for traversing \a hash. The iterator is
1060 set to be at the front of the hash (before the first item).
1061
1062 \sa operator=()
1063*/
1064
1065/*! \fn template <class Key, class T> QMapIterator &QMapIterator<Key, T>::operator=(const QMap<Key, T> &map)
1066 \fn template <class Key, class T> QMutableMapIterator &QMutableMapIterator<Key, T>::operator=(QMap<Key, T> &map)
1067 \fn template <class Key, class T> QMultiMapIterator &QMultiMapIterator<Key, T>::operator=(const QMultiMap<Key, T> &map)
1068 \fn template <class Key, class T> QMutableMultiMapIterator &QMutableMultiMapIterator<Key, T>::operator=(QMultiMap<Key, T> &map)
1069
1070 Makes the iterator operate on \a map. The iterator is set to be
1071 at the front of the map (before the first item).
1072
1073 \sa toFront(), toBack()
1074*/
1075
1076/*! \fn template <class Key, class T> QHashIterator &QHashIterator<Key, T>::operator=(const QHash<Key, T> &hash)
1077 \fn template <class Key, class T> QMutableHashIterator &QMutableHashIterator<Key, T>::operator=(QHash<Key, T> &hash)
1078
1079 Makes the iterator operate on \a hash. The iterator is set to be
1080 at the front of the hash (before the first item).
1081
1082 \sa toFront(), toBack()
1083*/
1084
1085/*! \fn template <class Key, class T> void QMapIterator<Key, T>::toFront()
1086 \fn template <class Key, class T> void QMultiMapIterator<Key, T>::toFront()
1087 \fn template <class Key, class T> void QHashIterator<Key, T>::toFront()
1088 \fn template <class Key, class T> void QMutableMapIterator<Key, T>::toFront()
1089 \fn template <class Key, class T> void QMutableMultiMapIterator<Key, T>::toFront()
1090 \fn template <class Key, class T> void QMutableHashIterator<Key, T>::toFront()
1091
1092 Moves the iterator to the front of the container (before the
1093 first item).
1094
1095 \sa toBack(), next()
1096*/
1097
1098/*! \fn template <class Key, class T> void QMapIterator<Key, T>::toBack()
1099 \fn template <class Key, class T> void QMultiMapIterator<Key, T>::toBack()
1100 \fn template <class Key, class T> void QMutableMapIterator<Key, T>::toBack()
1101 \fn template <class Key, class T> void QMutableMultiMapIterator<Key, T>::toBack()
1102
1103 Moves the iterator to the back of the container (after the last
1104 item).
1105
1106 \sa toFront(), previous()
1107*/
1108
1109/*!
1110 \fn template <class Key, class T> void QHashIterator<Key, T>::toBack()
1111 \fn template <class Key, class T> void QMutableHashIterator<Key, T>::toBack()
1112
1113 Moves the iterator to the back of the container (after the last
1114 item).
1115
1116 \sa toFront()
1117*/
1118
1119/*! \fn template <class Key, class T> bool QMapIterator<Key, T>::hasNext() const
1120 \fn template <class Key, class T> bool QMultiMapIterator<Key, T>::hasNext() const
1121 \fn template <class Key, class T> bool QMutableMapIterator<Key, T>::hasNext() const
1122 \fn template <class Key, class T> bool QMutableMultiMapIterator<Key, T>::hasNext() const
1123
1124 Returns \c true if there is at least one item ahead of the iterator,
1125 i.e. the iterator is \e not at the back of the container;
1126 otherwise returns \c false.
1127
1128 \sa hasPrevious(), next()
1129*/
1130
1131/*!
1132 \fn template <class Key, class T> bool QHashIterator<Key, T>::hasNext() const
1133 \fn template <class Key, class T> bool QMutableHashIterator<Key, T>::hasNext() const
1134
1135 Returns \c true if there is at least one item ahead of the iterator,
1136 i.e. the iterator is \e not at the back of the container;
1137 otherwise returns \c false.
1138
1139 \sa next()
1140*/
1141
1142/*! \fn template <class Key, class T> QMapIterator<Key, T>::Item QMapIterator<Key, T>::next()
1143 \fn template <class Key, class T> QMultiMapIterator<Key, T>::Item QMultiMapIterator<Key, T>::next()
1144
1145 Returns the next item and advances the iterator by one position.
1146
1147 Call key() on the return value to obtain the item's key, and
1148 value() to obtain the value.
1149
1150 Calling this function on an iterator located at the back of the
1151 container leads to undefined results.
1152
1153 \sa hasNext(), {QMapIterator::}{peekNext()}, previous()
1154*/
1155
1156/*! \fn template <class Key, class T> QMutableMapIterator<Key, T>::Item QMutableMapIterator<Key, T>::next()
1157 \fn template <class Key, class T> QMutableMultiMapIterator<Key, T>::Item QMutableMultiMapIterator<Key, T>::next()
1158
1159 Returns the next item and advances the iterator by one position.
1160
1161 Call key() on the return value to obtain the item's key, and
1162 value() to obtain the value.
1163
1164 Calling this function on an iterator located at the back of the
1165 container leads to undefined results.
1166
1167 \sa hasNext(), peekNext(), previous()
1168*/
1169
1170/*!
1171 \fn template <class Key, class T> QHashIterator<Key, T>::Item QHashIterator<Key, T>::next()
1172
1173 Returns the next item and advances the iterator by one position.
1174
1175 Call key() on the return value to obtain the item's key, and
1176 value() to obtain the value.
1177
1178 Calling this function on an iterator located at the back of the
1179 container leads to undefined results.
1180
1181 \sa hasNext(), peekNext()
1182*/
1183
1184/*!
1185 \fn template <class Key, class T> QMutableHashIterator<Key, T>::Item QMutableHashIterator<Key, T>::next()
1186
1187 Returns the next item and advances the iterator by one position.
1188
1189 Call key() on the return value to obtain the item's key, and
1190 value() to obtain the value.
1191
1192 Calling this function on an iterator located at the back of the
1193 container leads to undefined results.
1194
1195 \sa hasNext(), peekNext()
1196*/
1197
1198/*! \fn template <class Key, class T> QMapIterator<Key, T>::Item QMapIterator<Key, T>::peekNext() const
1199 \fn template <class Key, class T> QMutableMapIterator<Key, T>::Item QMutableMapIterator<Key, T>::peekNext() const
1200
1201 Returns the next item without moving the iterator.
1202
1203 Call key() on the return value to obtain the item's key, and
1204 value() to obtain the value.
1205
1206 Calling this function on an iterator located at the back of the
1207 container leads to undefined results.
1208
1209 \sa hasNext(), next(), peekPrevious()
1210*/
1211
1212/*!
1213 \fn template <class Key, class T> QMutableMultiMapIterator<Key, T>::Item QMutableMultiMapIterator<Key, T>::peekNext() const
1214
1215 Returns a reference to the next item without moving the iterator.
1216
1217 Call key() on the return value to obtain the item's key, and
1218 value() to obtain the value.
1219
1220 Calling this function on an iterator located at the back of the
1221 container leads to undefined results.
1222
1223 \sa hasNext(), next(), peekPrevious()
1224*/
1225
1226/*!
1227 \fn template <class Key, class T> QHashIterator<Key, T>::Item QHashIterator<Key, T>::peekNext() const
1228
1229 Returns the next item without moving the iterator.
1230
1231 Call key() on the return value to obtain the item's key, and
1232 value() to obtain the value.
1233
1234 Calling this function on an iterator located at the back of the
1235 container leads to undefined results.
1236
1237 \sa hasNext(), next()
1238*/
1239
1240/*!
1241 \fn template <class Key, class T> QMutableHashIterator<Key, T>::Item QMutableHashIterator<Key, T>::peekNext() const
1242
1243 Returns a reference to the next item without moving the iterator.
1244
1245 Call key() on the return value to obtain the item's key, and
1246 value() to obtain the value.
1247
1248 Calling this function on an iterator located at the back of the
1249 container leads to undefined results.
1250
1251 \sa hasNext(), next()
1252*/
1253
1254/*! \fn template <class Key, class T> bool QMapIterator<Key, T>::hasPrevious() const
1255 \fn template <class Key, class T> bool QMultiMapIterator<Key, T>::hasPrevious() const
1256 \fn template <class Key, class T> bool QMutableMapIterator<Key, T>::hasPrevious() const
1257 \fn template <class Key, class T> bool QMutableMultiMapIterator<Key, T>::hasPrevious() const
1258
1259 Returns \c true if there is at least one item behind the iterator,
1260 i.e. the iterator is \e not at the front of the container;
1261 otherwise returns \c false.
1262
1263 \sa hasNext(), previous()
1264*/
1265
1266/*! \fn template <class Key, class T> QMapIterator<Key, T>::Item QMapIterator<Key, T>::previous()
1267 \fn template <class Key, class T> QMutableMapIterator<Key, T>::Item QMutableMapIterator<Key, T>::previous()
1268 \fn template <class Key, class T> QMultiMapIterator<Key, T>::Item QMultiMapIterator<Key, T>::previous()
1269 \fn template <class Key, class T> QMutableMultiMapIterator<Key, T>::Item QMutableMultiMapIterator<Key, T>::previous()
1270
1271 Returns the previous item and moves the iterator back by one
1272 position.
1273
1274 Call key() on the return value to obtain the item's key, and
1275 value() to obtain the value.
1276
1277 Calling this function on an iterator located at the front of the
1278 container leads to undefined results.
1279
1280 \sa hasPrevious(), peekPrevious(), next()
1281*/
1282
1283/*! \fn template <class Key, class T> QMapIterator<Key, T>::Item QMapIterator<Key, T>::peekPrevious() const
1284 \fn template <class Key, class T> QMutableMapIterator<Key, T>::Item QMutableMapIterator<Key, T>::peekPrevious() const
1285 \fn template <class Key, class T> QMultiMapIterator<Key, T>::Item QMultiMapIterator<Key, T>::peekPrevious() const
1286 \fn template <class Key, class T> QMutableMultiMapIterator<Key, T>::Item QMutableMultiMapIterator<Key, T>::peekPrevious() const
1287
1288 Returns the previous item without moving the iterator.
1289
1290 Call key() on the return value to obtain the item's key, and
1291 value() to obtain the value.
1292
1293 Calling this function on an iterator located at the front of the
1294 container leads to undefined results.
1295
1296 \sa hasPrevious(), previous(), {QMapIterator::}{peekNext()}
1297*/
1298
1299/*! \fn template <class Key, class T> const T &QMapIterator<Key, T>::value() const
1300 \fn template <class Key, class T> const T &QMultiMapIterator<Key, T>::value() const
1301
1302 Returns the value of the last item that was jumped over using one
1303 of the traversal functions (next(), previous(), findNext(),
1304 findPrevious()).
1305
1306 After a call to next() or findNext(), value() is
1307 equivalent to peekPrevious().value(). After a call to previous()
1308 or findPrevious(), value() is equivalent to peekNext().value().
1309
1310 \sa key()
1311*/
1312
1313/*!
1314 \fn template <class Key, class T> const T &QMutableMapIterator<Key, T>::value() const
1315 \fn template <class Key, class T> const T &QMutableMultiMapIterator<Key, T>::value() const
1316
1317 Returns the value of the last item that was jumped over using one
1318 of the traversal functions (next(), previous(), findNext(),
1319 findPrevious()).
1320
1321 After a call to next() or findNext(), value() is
1322 equivalent to peekPrevious().value(). After a call to previous()
1323 or findPrevious(), value() is equivalent to peekNext().value().
1324
1325 \sa key(), setValue()
1326*/
1327
1328/*! \fn template <class Key, class T> const T &QHashIterator<Key, T>::value() const
1329
1330 Returns the value of the last item that was jumped over using one
1331 of the traversal functions (next(), findNext()).
1332
1333 \sa key()
1334*/
1335
1336/*!
1337 \fn template <class Key, class T> const T &QMutableHashIterator<Key, T>::value() const
1338
1339 Returns the value of the last item that was jumped over using one
1340 of the traversal functions (next(), findNext()).
1341
1342 \sa key(), setValue()
1343*/
1344
1345/*!
1346 \fn template <class Key, class T> T &QMutableMapIterator<Key, T>::value()
1347 \fn template <class Key, class T> T &QMutableMultiMapIterator<Key, T>::value()
1348 \fn template <class Key, class T> T &QMutableHashIterator<Key, T>::value()
1349 \overload
1350
1351 Returns a non-const reference to the value of
1352 the last item that was jumped over using one
1353 of the traversal functions.
1354*/
1355
1356/*! \fn template <class Key, class T> const Key &QMapIterator<Key, T>::key() const
1357 \fn template <class Key, class T> const Key &QMutableMapIterator<Key, T>::key() const
1358 \fn template <class Key, class T> const Key &QMultiMapIterator<Key, T>::key() const
1359 \fn template <class Key, class T> const Key &QMutableMultiMapIterator<Key, T>::key() const
1360
1361 Returns the key of the last item that was jumped over using one
1362 of the traversal functions (next(), previous(), findNext(),
1363 findPrevious()).
1364
1365 After a call to next() or findNext(), key() is
1366 equivalent to peekPrevious().key(). After a call to previous() or
1367 findPrevious(), key() is equivalent to peekNext().key().
1368
1369 \sa value()
1370*/
1371
1372/*! \fn template <class Key, class T> const Key &QHashIterator<Key, T>::key() const
1373 \fn template <class Key, class T> const Key &QMutableHashIterator<Key, T>::key() const
1374
1375 Returns the key of the last item that was jumped over using one
1376 of the traversal functions (next(), findNext()).
1377
1378 \sa value()
1379*/
1380
1381/*! \fn template <class Key, class T> bool QMapIterator<Key, T>::findNext(const T &value)
1382 \fn template <class Key, class T> bool QMutableMapIterator<Key, T>::findNext(const T &value)
1383 \fn template <class Key, class T> bool QMultiMapIterator<Key, T>::findNext(const T &value)
1384 \fn template <class Key, class T> bool QMutableMultiMapIterator<Key, T>::findNext(const T &value)
1385
1386 Searches for \a value starting from the current iterator position
1387 forward. Returns \c true if a (key, value) pair with value \a value
1388 is found; otherwise returns \c false.
1389
1390 After the call, if \a value was found, the iterator is positioned
1391 just after the matching item; otherwise, the iterator is
1392 positioned at the back of the container.
1393
1394 \sa findPrevious()
1395*/
1396
1397/*! \fn template <class Key, class T> bool QHashIterator<Key, T>::findNext(const T &value)
1398 \fn template <class Key, class T> bool QMutableHashIterator<Key, T>::findNext(const T &value)
1399
1400 Searches for \a value starting from the current iterator position
1401 forward. Returns \c true if a (key, value) pair with value \a value
1402 is found; otherwise returns \c false.
1403
1404 After the call, if \a value was found, the iterator is positioned
1405 just after the matching item; otherwise, the iterator is
1406 positioned at the back of the container.
1407*/
1408
1409/*! \fn template <class Key, class T> bool QMapIterator<Key, T>::findPrevious(const T &value)
1410 \fn template <class Key, class T> bool QMutableMapIterator<Key, T>::findPrevious(const T &value)
1411 \fn template <class Key, class T> bool QMultiMapIterator<Key, T>::findPrevious(const T &value)
1412 \fn template <class Key, class T> bool QMutableMultiMapIterator<Key, T>::findPrevious(const T &value)
1413
1414 Searches for \a value starting from the current iterator position
1415 backward. Returns \c true if a (key, value) pair with value \a value
1416 is found; otherwise returns \c false.
1417
1418 After the call, if \a value was found, the iterator is positioned
1419 just before the matching item; otherwise, the iterator is
1420 positioned at the front of the container.
1421
1422 \sa findNext()
1423*/
1424
1425/*! \fn template <class Key, class T> void QMutableMapIterator<Key, T>::remove()
1426 \fn template <class Key, class T> void QMutableMultiMapIterator<Key, T>::remove()
1427
1428 Removes the last item that was jumped over using one of the
1429 traversal functions (next(), previous(), findNext(), findPrevious()).
1430
1431 \sa setValue()
1432*/
1433
1434/*! \fn template <class Key, class T> void QMutableHashIterator<Key, T>::remove()
1435
1436 Removes the last item that was jumped over using one of the
1437 traversal functions (next(), findNext()).
1438
1439 \sa setValue()
1440*/
1441
1442/*! \fn template <class Key, class T> void QMutableMapIterator<Key, T>::setValue(const T &value)
1443 \fn template <class Key, class T> void QMutableMultiMapIterator<Key, T>::setValue(const T &value)
1444
1445 Replaces the value of the last item that was jumped over using
1446 one of the traversal functions with \a value.
1447
1448 The traversal functions are next(), previous(), findNext(), and
1449 findPrevious().
1450
1451 \sa key(), value(), remove()
1452*/
1453
1454/*!
1455 \fn template <class Key, class T> void QMutableHashIterator<Key, T>::setValue(const T &value)
1456
1457 Replaces the value of the last item that was jumped over using
1458 one of the traversal functions with \a value.
1459
1460 The traversal functions are next() and findNext().
1461
1462 \sa key(), value(), remove()
1463*/