Merge remote-tracking branch 'origin/master' into api_changes
[profile/ivi/qtbase.git] / src / corelib / tools / qset.qdoc
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
5 **
6 ** This file is part of the documentation of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:FDL$
9 ** GNU Free Documentation License
10 ** Alternatively, this file may be used under the terms of the GNU Free
11 ** Documentation License version 1.3 as published by the Free Software
12 ** Foundation and appearing in the file included in the packaging of
13 ** this file.
14 **
15 ** Other Usage
16 ** Alternatively, this file may be used in accordance with the terms
17 ** and conditions contained in a signed written agreement between you
18 ** and Nokia.
19 **
20 **
21 **
22 **
23 **
24 ** $QT_END_LICENSE$
25 **
26 ****************************************************************************/
27
28 /*!
29     \class QSet
30     \brief The QSet class is a template class that provides a hash-table-based set.
31
32     \ingroup tools
33     \ingroup shared
34     \reentrant
35
36
37     QSet<T> is one of Qt's generic \l{container classes}. It stores
38     values in an unspecified order and provides very fast lookup of
39     the values. Internally, QSet<T> is implemented as a QHash.
40
41     Here's an example QSet with QString values:
42
43     \snippet doc/src/snippets/code/doc_src_qset.cpp 0
44
45     To insert a value into the set, use insert():
46
47     \snippet doc/src/snippets/code/doc_src_qset.cpp 1
48
49     Another way to insert items into the set is to use operator<<():
50
51     \snippet doc/src/snippets/code/doc_src_qset.cpp 2
52
53     To test whether an item belongs to the set or not, use contains():
54
55     \snippet doc/src/snippets/code/doc_src_qset.cpp 3
56
57     If you want to navigate through all the values stored in a QSet,
58     you can use an iterator. QSet supports both \l{Java-style
59     iterators} (QSetIterator and QMutableSetIterator) and \l{STL-style
60     iterators} (QSet::iterator and QSet::const_iterator). Here's how
61     to iterate over a QSet<QWidget *> using a Java-style iterator:
62
63     \snippet doc/src/snippets/code/doc_src_qset.cpp 4
64
65     Here's the same code, but using an STL-style iterator:
66
67     \snippet doc/src/snippets/code/doc_src_qset.cpp 5
68
69     QSet is unordered, so an iterator's sequence cannot be assumed to
70     be predictable. If ordering by key is required, use a QMap.
71
72     To navigate through a QSet, you can also use \l{foreach}:
73
74     \snippet doc/src/snippets/code/doc_src_qset.cpp 6
75
76     Items can be removed from the set using remove(). There is also a
77     clear() function that removes all items.
78
79     QSet's value data type must be an \l{assignable data type}. You
80     cannot, for example, store a QWidget as a value; instead, store a
81     QWidget *. In addition, the type must provide \c operator==(), and
82     there must also be a global qHash() function that returns a hash
83     value for an argument of the key's type. See the QHash
84     documentation for a list of types supported by qHash().
85
86     Internally, QSet uses a hash table to perform lookups. The hash
87     table automatically grows and shrinks to provide fast lookups
88     without wasting memory. You can still control the size of the hash
89     table by calling reserve(), if you already know approximately how
90     many elements the QSet will contain, but this isn't necessary to
91     obtain good performance. You can also call capacity() to retrieve
92     the hash table's size.
93
94     \sa QSetIterator, QMutableSetIterator, QHash, QMap
95 */
96
97 /*!
98     \fn QSet::QSet()
99
100     Constructs an empty set.
101
102     \sa clear()
103 */
104
105 /*!
106     \fn QSet::QSet(const QSet<T> &other)
107
108     Constructs a copy of \a other.
109
110     This operation occurs in \l{constant time}, because QSet is
111     \l{implicitly shared}. This makes returning a QSet from a
112     function very fast. If a shared instance is modified, it will be
113     copied (copy-on-write), and this takes \l{linear time}.
114
115     \sa operator=()
116 */
117
118 /*!
119     \fn QSet<T> &QSet::operator=(const QSet<T> &other)
120
121     Assigns the \a other set to this set and returns a reference to
122     this set.  
123 */
124
125 /*!
126     \fn void QSet::swap(QSet<T> &other)
127
128     Swaps set \a other with this set. This operation is very fast and
129     never fails.
130 */
131
132 /*!
133     \fn bool QSet::operator==(const QSet<T> &other) const
134
135     Returns true if the \a other set is equal to this set; otherwise
136     returns false.
137
138     Two sets are considered equal if they contain the same elements.
139
140     This function requires the value type to implement \c operator==().
141
142     \sa operator!=()
143 */
144
145 /*!
146     \fn bool QSet::operator!=(const QSet<T> &other) const
147
148     Returns true if the \a other set is not equal to this set; otherwise
149     returns false.
150
151     Two sets are considered equal if they contain the same elements.
152
153     This function requires the value type to implement \c operator==().
154
155     \sa operator==()
156 */
157
158 /*!
159     \fn int QSet::size() const
160
161     Returns the number of items in the set.
162
163     \sa isEmpty(), count()
164 */
165
166 /*!
167     \fn bool QSet::isEmpty() const
168
169     Returns true if the set contains no elements; otherwise returns
170     false.
171
172     \sa size()
173 */
174
175 /*!
176     \fn int QSet::capacity() const
177
178     Returns the number of buckets in the set's internal hash
179     table.
180
181     The sole purpose of this function is to provide a means of fine
182     tuning QSet's memory usage. In general, you will rarely ever need
183     to call this function. If you want to know how many items are in
184     the set, call size().
185
186     \sa reserve(), squeeze()
187 */
188
189 /*! \fn void QSet::reserve(int size)
190
191     Ensures that the set's internal hash table consists of at
192     least \a size buckets.
193
194     This function is useful for code that needs to build a huge set
195     and wants to avoid repeated reallocation. For example:
196
197     \snippet doc/src/snippets/code/doc_src_qset.cpp 7
198
199     Ideally, \a size should be slightly more than the maximum number
200     of elements expected in the set. \a size doesn't have to be prime,
201     because QSet will use a prime number internally anyway. If \a size
202     is an underestimate, the worst that will happen is that the QSet
203     will be a bit slower.
204
205     In general, you will rarely ever need to call this function.
206     QSet's internal hash table automatically shrinks or grows to
207     provide good performance without wasting too much memory.
208
209     \sa squeeze(), capacity()
210 */
211
212 /*!
213     \fn void QSet::squeeze()
214
215     Reduces the size of the set's internal hash table to save
216     memory.
217
218     The sole purpose of this function is to provide a means of fine
219     tuning QSet's memory usage. In general, you will rarely ever
220     need to call this function.
221
222     \sa reserve(), capacity()
223 */
224
225 /*!
226     \fn void QSet::detach()
227
228     \internal
229
230     Detaches this set from any other sets with which it may share
231     data.
232
233     \sa isDetached()
234 */
235
236 /*! \fn bool QSet::isDetached() const
237
238     \internal
239
240     Returns true if the set's internal data isn't shared with any
241     other set object; otherwise returns false.
242
243     \sa detach()
244 */
245
246 /*!
247     \fn void QSet::setSharable(bool sharable)
248     \internal
249 */
250
251 /*!
252     \fn void QSet::clear()
253
254     Removes all elements from the set.
255
256     \sa remove()
257 */
258
259 /*!
260     \fn bool QSet::remove(const T &value)
261
262     Removes any occurrence of item \a value from the set. Returns
263     true if an item was actually removed; otherwise returns false.
264
265     \sa contains(), insert()
266 */
267
268 /*!
269     \fn QSet::iterator QSet::erase(iterator pos)
270     \since 4.2
271
272     Removes the item at the iterator position \a pos from the set, and
273     returns an iterator positioned at the next item in the set.
274
275     Unlike remove(), this function never causes QSet to rehash its
276     internal data structure. This means that it can safely be called
277     while iterating, and won't affect the order of items in the set.
278
279     \sa remove(), find()
280 */
281
282 /*! \fn QSet::const_iterator QSet::find(const T &value) const
283     \since 4.2
284
285     Returns a const iterator positioned at the item \a value in the
286     set. If the set contains no item \a value, the function returns
287     constEnd().
288
289     \sa constFind(), contains()
290 */
291
292 /*! \fn QSet::iterator QSet::find(const T &value)
293     \since 4.2
294     \overload
295
296     Returns a non-const iterator positioned at the item \a value in
297     the set. If the set contains no item \a value, the function
298     returns end(). 
299 */
300
301 /*! \fn QSet::const_iterator QSet::constFind(const T &value) const
302     \since 4.2
303
304     Returns a const iterator positioned at the item \a value in the
305     set. If the set contains no item \a value, the function returns
306     constEnd().
307
308     \sa find(), contains()
309 */
310
311 /*!
312     \fn bool QSet::contains(const T &value) const
313
314     Returns true if the set contains item \a value; otherwise returns
315     false.
316
317     \sa insert(), remove(), find()
318 */
319
320 /*!
321     \fn bool QSet::contains(const QSet<T> &other) const
322     \since 4.6
323
324     Returns true if the set contains all items from the \a other set;
325     otherwise returns false.
326
327     \sa insert(), remove(), find()
328 */
329
330 /*! \fn QSet::const_iterator QSet::begin() const
331
332     Returns a const \l{STL-style iterator} positioned at the first
333     item in the set.
334
335     \sa constBegin(), end()
336 */
337
338 /*! \fn QSet::iterator QSet::begin()
339     \since 4.2
340     \overload
341
342     Returns a non-const \l{STL-style iterator} positioned at the first
343     item in the set.  
344 */
345
346 /*! \fn QSet::const_iterator QSet::cbegin() const
347     \since 5.0
348
349     Returns a const \l{STL-style iterator} positioned at the first
350     item in the set.
351
352     \sa begin(), cend()
353 */
354
355 /*! \fn QSet::const_iterator QSet::constBegin() const
356
357     Returns a const \l{STL-style iterator} positioned at the first
358     item in the set.
359
360     \sa begin(), constEnd()
361 */
362
363 /*! \fn QSet::const_iterator QSet::end() const
364
365     Returns a const \l{STL-style iterator} positioned at the imaginary
366     item after the last item in the set.
367
368     \sa constEnd(), begin()
369 */
370
371 /*! \fn QSet::iterator QSet::end()
372     \since 4.2
373     \overload
374
375     Returns a non-const \l{STL-style iterator} pointing to the
376     imaginary item after the last item in the set.
377 */
378
379 /*! \fn QSet::const_iterator QSet::cend() const
380     \since 5.0
381
382     Returns a const \l{STL-style iterator} pointing to the imaginary
383     item after the last item in the set.
384
385     \sa cbegin(), end()
386 */
387
388 /*! \fn QSet::const_iterator QSet::constEnd() const
389
390     Returns a const \l{STL-style iterator} pointing to the imaginary
391     item after the last item in the set.
392
393     \sa constBegin(), end()
394 */
395
396 /*!
397     \typedef QSet::Iterator
398     \since 4.2
399
400     Qt-style synonym for QSet::iterator.
401 */
402
403 /*!
404     \typedef QSet::ConstIterator
405
406     Qt-style synonym for QSet::const_iterator.
407 */
408
409 /*!
410     \typedef QSet::const_pointer
411
412     Typedef for const T *. Provided for STL compatibility.
413 */
414
415 /*!
416     \typedef QSet::const_reference
417
418     Typedef for const T &. Provided for STL compatibility.
419 */
420
421 /*!
422     \typedef QSet::difference_type
423
424     Typedef for const ptrdiff_t. Provided for STL compatibility.
425 */
426
427 /*!
428     \typedef QSet::key_type
429
430     Typedef for T. Provided for STL compatibility.
431 */
432
433 /*!
434     \typedef QSet::pointer
435
436     Typedef for T *. Provided for STL compatibility.
437 */
438
439 /*!
440     \typedef QSet::reference
441
442     Typedef for T &. Provided for STL compatibility.
443 */
444
445 /*!
446     \typedef QSet::size_type
447
448     Typedef for int. Provided for STL compatibility.
449 */
450
451 /*!
452     \typedef QSet::value_type
453
454     Typedef for T. Provided for STL compatibility.
455 */
456
457 /*!
458     \fn QSet::const_iterator QSet::insert(const T &value)
459
460     Inserts item \a value into the set, if \a value isn't already
461     in the set, and returns an iterator pointing at the inserted
462     item.
463
464     \sa operator<<(), remove(), contains()
465 */
466
467 /*!
468     \fn QSet<T> &QSet::unite(const QSet<T> &other)
469
470     Each item in the \a other set that isn't already in this set is
471     inserted into this set. A reference to this set is returned.
472
473     \sa operator|=(), intersect(), subtract()
474 */
475
476 /*!
477     \fn QSet<T> &QSet::intersect(const QSet<T> &other)
478
479     Removes all items from this set that are not contained in the
480     \a other set. A reference to this set is returned.
481
482     \sa operator&=(), unite(), subtract()
483 */
484
485 /*!
486     \fn QSet<T> &QSet::subtract(const QSet<T> &other)
487
488     Removes all items from  this set that are contained in the 
489     \a other set. Returns a reference to this set.
490
491     \sa operator-=(), unite(), intersect()
492 */
493
494 /*!
495     \fn bool QSet::empty() const
496
497     Returns true if the set is empty. This function is provided
498     for STL compatibility. It is equivalent to isEmpty().  
499 */
500
501 /*!
502     \fn bool QSet::count() const
503
504     Same as size().
505 */
506
507 /*!
508     \fn QSet<T> &QSet::operator<<(const T &value)
509     \fn QSet<T> &QSet::operator+=(const T &value)
510     \fn QSet<T> &QSet::operator|=(const T &value)
511
512     Inserts a new item \a value and returns a reference to the set.
513     If \a value already exists in the set, the set is left unchanged.
514
515     \sa insert()
516 */
517
518 /*!
519     \fn QSet<T> &QSet::operator-=(const T &value)
520
521     Removes the occurrence of item \a value from the set, if 
522     it is found, and returns a reference to the set. If the
523     \a value is not contained the set, nothing is removed.
524
525     \sa remove()
526 */
527
528 /*!
529     \fn QSet<T> &QSet::operator|=(const QSet<T> &other)
530     \fn QSet<T> &QSet::operator+=(const QSet<T> &other)
531
532     Same as unite(\a other).
533
534     \sa operator|(), operator&=(), operator-=()
535 */
536
537 /*!
538     \fn QSet<T> &QSet::operator&=(const QSet<T> &other)
539
540     Same as intersect(\a other).
541
542     \sa operator&(), operator|=(), operator-=()
543 */
544
545 /*!
546     \fn QSet<T> &QSet::operator&=(const T &value)
547
548     \overload
549
550     Same as intersect(\e{other}), if we consider \e{other} to be a set
551     that contains the singleton \a value.  
552 */
553
554
555 /*!
556     \fn QSet<T> &QSet::operator-=(const QSet<T> &other)
557
558     Same as subtract(\a{other}).
559
560     \sa operator-(), operator|=(), operator&=()
561 */
562
563 /*!
564     \fn QSet<T> QSet::operator|(const QSet<T> &other) const
565     \fn QSet<T> QSet::operator+(const QSet<T> &other) const
566
567     Returns a new QSet that is the union of this set and the 
568     \a other set.
569
570     \sa unite(), operator|=(), operator&(), operator-()
571 */
572
573 /*!
574     \fn QSet<T> QSet::operator&(const QSet<T> &other) const
575
576     Returns a new QSet that is the intersection of this set and the
577     \a other set.
578
579     \sa intersect(), operator&=(), operator|(), operator-()
580 */
581
582 /*!
583     \fn QSet<T> QSet::operator-(const QSet<T> &other) const
584
585     Returns a new QSet that is the set difference of this set and
586     the \a other set, i.e., this set - \a other set.
587
588     \sa subtract(), operator-=(), operator|(), operator&()
589 */
590
591 /*!
592     \class QSet::iterator
593     \since 4.2
594     \brief The QSet::iterator class provides an STL-style non-const iterator for QSet.
595
596     QSet features both \l{STL-style iterators} and
597     \l{Java-style iterators}. The STL-style iterators are more
598     low-level and more cumbersome to use; on the other hand, they are
599     slightly faster and, for developers who already know STL, have
600     the advantage of familiarity.
601
602     QSet<T>::iterator allows you to iterate over a QSet and to remove
603     items (using QSet::erase()) while you iterate. (QSet doesn't let
604     you \e modify a value through an iterator, because that
605     would potentially require moving the value in the internal hash
606     table used by QSet.) If you want to iterate over a const QSet,
607     you should use QSet::const_iterator. It is generally good
608     practice to use QSet::const_iterator on a non-const QSet as well,
609     unless you need to change the QSet through the iterator. Const
610     iterators are slightly faster, and can improve code readability.
611
612     QSet\<T\>::iterator allows you to iterate over a QSet\<T\> and
613     modify it as you go (using QSet::erase()). However, 
614
615     The default QSet::iterator constructor creates an uninitialized
616     iterator. You must initialize it using a function like
617     QSet::begin(), QSet::end(), or QSet::insert() before you can
618     start iterating. Here's a typical loop that prints all the items
619     stored in a set:
620
621     \snippet doc/src/snippets/code/doc_src_qset.cpp 8
622
623     Here's a loop that removes certain items (all those that start
624     with 'J') from a set while iterating:
625
626     \snippet doc/src/snippets/code/doc_src_qset.cpp 9
627
628     STL-style iterators can be used as arguments to \l{generic
629     algorithms}. For example, here's how to find an item in the set
630     using the qFind() algorithm:
631
632     \snippet doc/src/snippets/code/doc_src_qset.cpp 10
633
634     Multiple iterators can be used on the same set. However, you may
635     not attempt to modify the container while iterating on it.
636
637     \sa QSet::const_iterator, QMutableSetIterator
638 */
639
640 /*!
641     \class QSet::const_iterator
642     \brief The QSet::const_iterator class provides an STL-style const iterator for QSet.
643     \since 4.2
644
645     QSet features both \l{STL-style iterators} and
646     \l{Java-style iterators}. The STL-style iterators are more
647     low-level and more cumbersome to use; on the other hand, they are
648     slightly faster and, for developers who already know STL, have
649     the advantage of familiarity.
650
651     QSet\<Key, T\>::const_iterator allows you to iterate over a QSet.
652     If you want to modify the QSet as you iterate over it, you must
653     use QSet::iterator instead. It is generally good practice to use
654     QSet::const_iterator on a non-const QSet as well, unless you need
655     to change the QSet through the iterator. Const iterators are
656     slightly faster, and can improve code readability.
657
658     The default QSet::const_iterator constructor creates an
659     uninitialized iterator. You must initialize it using a function
660     like QSet::begin(), QSet::end(), or QSet::insert() before you can
661     start iterating. Here's a typical loop that prints all the items
662     stored in a set:
663
664     \snippet doc/src/snippets/code/doc_src_qset.cpp 11
665
666     STL-style iterators can be used as arguments to \l{generic
667     algorithms}. For example, here's how to find an item in the set
668     using the qFind() algorithm:
669
670     \snippet doc/src/snippets/code/doc_src_qset.cpp 12
671
672     Multiple iterators can be used on the same set. However, you may
673     not attempt to modify the container while iterating on it.
674
675     \sa QSet::iterator, QSetIterator
676 */
677
678 /*!
679     \fn QSet::iterator::iterator()
680     \fn QSet::const_iterator::const_iterator()
681
682     Constructs an uninitialized iterator.
683
684     Functions like operator*() and operator++() should not be called
685     on an uninitialized iterator. Use operator=() to assign a value
686     to it before using it.
687
688     \sa QSet::begin(), QSet::end()
689 */
690
691 /*! 
692     \fn QSet::iterator::iterator(typename Hash::iterator i)
693     \fn QSet::const_iterator::const_iterator(typename Hash::const_iterator i)
694
695     \internal
696 */
697
698 /*!
699   \typedef QSet::iterator::iterator_category
700   \typedef QSet::const_iterator::iterator_category
701
702   Synonyms for \e {std::bidirectional_iterator_tag} indicating
703   these iterators are bidirectional iterators.
704  */
705
706 /*!
707     \typedef QSet::iterator::difference_type
708     \typedef QSet::const_iterator::difference_type
709
710     \internal
711 */
712
713 /*!
714     \typedef QSet::iterator::value_type
715     \typedef QSet::const_iterator::value_type
716
717     \internal
718 */
719
720 /*!
721     \typedef QSet::iterator::pointer
722     \typedef QSet::const_iterator::pointer
723
724     \internal
725 */
726
727 /*!
728     \typedef QSet::iterator::reference
729     \typedef QSet::const_iterator::reference
730
731     \internal
732 */
733
734 /*!
735     \fn QSet::iterator::iterator(const iterator &other)
736     \fn QSet::const_iterator::const_iterator(const const_iterator &other)
737
738     Constructs a copy of \a other.
739 */
740
741 /*!
742     \fn QSet::const_iterator::const_iterator(const iterator &other)
743     \since 4.2
744     \overload
745
746     Constructs a copy of \a other.
747 */
748
749 /*!
750     \fn QSet::iterator &QSet::iterator::operator=(const iterator &other)
751     \fn QSet::const_iterator &QSet::const_iterator::operator=(const const_iterator &other)
752
753     Assigns \a other to this iterator.
754 */
755
756 /*!
757     \fn const T &QSet::iterator::operator*() const
758     \fn const T &QSet::const_iterator::operator*() const
759
760     Returns a reference to the current item.
761
762     \sa operator->()
763 */
764
765 /*!
766     \fn const T *QSet::iterator::operator->() const
767     \fn const T *QSet::const_iterator::operator->() const
768
769     Returns a pointer to the current item.
770
771     \sa operator*()
772 */
773
774 /*!
775     \fn bool QSet::iterator::operator==(const iterator &other) const
776     \fn bool QSet::const_iterator::operator==(const const_iterator &other) const
777
778     Returns true if \a other points to the same item as this
779     iterator; otherwise returns false.
780
781     \sa operator!=()
782 */
783
784 /*!
785     \fn bool QSet::iterator::operator==(const const_iterator &other) const
786     \fn bool QSet::iterator::operator!=(const const_iterator &other) const
787
788     \overload
789 */
790
791 /*!
792     \fn bool QSet::iterator::operator!=(const iterator &other) const
793     \fn bool QSet::const_iterator::operator!=(const const_iterator &other) const
794
795     Returns true if \a other points to a different item than this
796     iterator; otherwise returns false.
797
798     \sa operator==()
799 */
800
801 /*!
802     \fn QSet::iterator &QSet::iterator::operator++()
803     \fn QSet::const_iterator &QSet::const_iterator::operator++()
804
805     The prefix ++ operator (\c{++it}) advances the iterator to the
806     next item in the set and returns an iterator to the new current
807     item.
808
809     Calling this function on QSet::constEnd() leads to
810     undefined results.
811
812     \sa operator--()
813 */
814
815 /*!
816     \fn QSet::iterator QSet::iterator::operator++(int)
817     \fn QSet::const_iterator QSet::const_iterator::operator++(int)
818
819     \overload
820
821     The postfix ++ operator (\c{it++}) advances the iterator to the
822     next item in the set and returns an iterator to the previously
823     current item.
824 */
825
826 /*!
827     \fn QSet::iterator &QSet::iterator::operator--()
828     \fn QSet::const_iterator &QSet::const_iterator::operator--()
829
830     The prefix -- operator (\c{--it}) makes the preceding item
831     current and returns an iterator to the new current item.
832
833     Calling this function on QSet::begin() leads to undefined
834     results.
835
836     \sa operator++()
837 */
838
839 /*!
840     \fn QSet::iterator QSet::iterator::operator--(int)
841     \fn QSet::const_iterator QSet::const_iterator::operator--(int)
842
843     \overload
844
845     The postfix -- operator (\c{it--}) makes the preceding item
846     current and returns an iterator to the previously current item.
847 */
848
849 /*!
850     \fn QSet::iterator QSet::iterator::operator+(int j) const
851     \fn QSet::const_iterator QSet::const_iterator::operator+(int j) const
852
853     Returns an iterator to the item at \a j positions forward from
854     this iterator. (If \a j is negative, the iterator goes backward.)
855
856     This operation can be slow for large \a j values.
857
858     \sa operator-()
859 */
860
861 /*!
862     \fn QSet::iterator QSet::iterator::operator-(int j) const
863     \fn QSet::const_iterator QSet::const_iterator::operator-(int j) const
864
865     Returns an iterator to the item at \a j positions backward from
866     this iterator. (If \a j is negative, the iterator goes forward.)
867
868     This operation can be slow for large \a j values.
869
870     \sa operator+()
871 */
872
873 /*!
874     \fn QSet::iterator &QSet::iterator::operator+=(int j)
875     \fn QSet::const_iterator &QSet::const_iterator::operator+=(int j)
876
877     Advances the iterator by \a j items. (If \a j is negative, the
878     iterator goes backward.)
879
880     This operation can be slow for large \a j values.
881
882     \sa operator-=(), operator+()
883 */
884
885 /*!
886     \fn QSet::iterator &QSet::iterator::operator-=(int j)
887     \fn QSet::const_iterator &QSet::const_iterator::operator-=(int j)
888
889     Makes the iterator go back by \a j items. (If \a j is negative,
890     the iterator goes forward.)
891
892     This operation can be slow for large \a j values.
893
894     \sa operator+=(), operator-()
895 */
896
897 /*! \fn QList<T> QSet<T>::toList() const
898
899     Returns a new QList containing the elements in the set. The
900     order of the elements in the QList is undefined.
901
902     Example:
903
904     \snippet doc/src/snippets/code/doc_src_qset.cpp 13
905
906     \sa fromList(), QList::fromSet(), qSort()
907 */
908
909 /*! \fn QList<T> QSet<T>::values() const
910
911     Returns a new QList containing the elements in the set. The
912     order of the elements in the QList is undefined.
913
914     This is the same as toList().
915
916     \sa fromList(), QList::fromSet(), qSort()
917 */
918
919
920 /*! \fn QSet<T> QSet<T>::fromList(const QList<T> &list)
921
922     Returns a new QSet object containing the data contained in \a
923     list. Since QSet doesn't allow duplicates, the resulting QSet
924     might be smaller than the \a list, because QList can contain
925     duplicates.
926
927     Example:
928
929     \snippet doc/src/snippets/code/doc_src_qset.cpp 14
930
931     \sa toList(), QList::toSet()
932 */
933
934 /*!
935     \fn QDataStream &operator<<(QDataStream &out, const QSet<T> &set)
936     \relates QSet
937
938     Writes the \a set to stream \a out.
939
940     This function requires the value type to implement \c operator<<().
941
942     \sa \link datastreamformat.html Format of the QDataStream operators \endlink
943 */
944
945 /*!
946     \fn QDataStream &operator>>(QDataStream &in, QSet<T> &set)
947     \relates QSet
948
949     Reads a set from stream \a in into \a set.
950
951     This function requires the value type to implement \c operator>>().
952
953     \sa \link datastreamformat.html Format of the QDataStream operators \endlink
954 */