1QIntDictIterator(3qt) QIntDictIterator(3qt)
2
3
4
6 QIntDictIterator - Iterator for QIntDict collections
7
9 #include <qintdict.h>
10
11 Public Members
12 QIntDictIterator ( const QIntDict<type> & dict )
13 ~QIntDictIterator ()
14 uint count () const
15 bool isEmpty () const
16 type * toFirst ()
17 operator type * () const
18 type * current () const
19 long currentKey () const
20 type * operator() ()
21 type * operator++ ()
22 type * operator+= ( uint jump )
23
25 The QIntDictIterator class provides an iterator for QIntDict
26 collections.
27
28 QIntDictIterator is implemented as a template class. Define a template
29 instance QIntDictIterator<X> to create a dictionary iterator that
30 operates on QIntDict<X> (dictionary of X*).
31
32 Example:
33
34 QIntDict<QLineEdit> fields;
35 for ( int i = 0; i < 3; i++ )
36 fields.insert( i, new QLineEdit( this ) );
37 fields[0]->setText( "Homer" );
38 fields[1]->setText( "Simpson" );
39 fields[2]->setText( "45" );
40 QIntDictIterator<QLineEdit> it( fields );
41 for ( ; it.current(); ++it )
42 cout << it.currentKey() << ": " << it.current()->text() << endl;
43 // Output (random order):
44 // 0: Homer
45 // 1: Simpson
46 // 2: 45
47
48 Note that the traversal order is arbitrary; you are not guaranteed the
49 order shown above.
50
51 Multiple iterators may independently traverse the same dictionary. A
52 QIntDict knows about all the iterators that are operating on the
53 dictionary. When an item is removed from the dictionary, QIntDict
54 updates all iterators that refer the removed item to point to the next
55 item in the traversal order.
56
57 See also QIntDict, Collection Classes, and Non-GUI Classes.
58
61 Constructs an iterator for dict. The current iterator item is set to
62 point to the 'first' item in the dict. The first item refers to the
63 first item in the dictionary's arbitrary internal ordering.
64
66 Destroys the iterator.
67
69 Returns the number of items in the dictionary this iterator operates
70 over.
71
72 See also isEmpty().
73
75 Returns a pointer to the current iterator item.
76
78 Returns the key for the current iterator item.
79
81 Returns TRUE if the dictionary is empty; otherwise eturns FALSE.
82
83 See also count().
84
86 Cast operator. Returns a pointer to the current iterator item. Same as
87 current().
88
90 Makes the succeeding item current and returns the original current
91 item.
92
93 If the current iterator item was the last item in the dictionary or if
94 it was 0, 0 is returned.
95
97 Prefix ++ makes the succeeding item current and returns the new current
98 item.
99
100 If the current iterator item was the last item in the dictionary or if
101 it was 0, 0 is returned.
102
104 Sets the current item to the item jump positions after the current
105 item, and returns a pointer to that item.
106
107 If that item is beyond the last item or if the dictionary is empty, it
108 sets the current item to 0 and returns 0.
109
111 Sets the current iterator item to point to the first item in the
112 dictionary and returns a pointer to the item. The first item refers to
113 the first item in the dictionary's arbitrary internal ordering. If the
114 dictionary is empty it sets the current item to 0 and returns 0.
115
116
118 http://doc.trolltech.com/qintdictiterator.html
119 http://www.trolltech.com/faq/tech.html
120
122 Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
123 license file included in the distribution for a complete license
124 statement.
125
127 Generated automatically from the source code.
128
130 If you find a bug in Qt, please report it as described in
131 http://doc.trolltech.com/bughowto.html. Good bug reports help us to
132 help you. Thank you.
133
134 The definitive Qt documentation is provided in HTML format; it is
135 located at $QTDIR/doc/html and can be read using Qt Assistant or with a
136 web browser. This man page is provided as a convenience for those users
137 who prefer man pages, although this format is not officially supported
138 by Trolltech.
139
140 If you find errors in this manual page, please report them to qt-
141 bugs@trolltech.com. Please include the name of the manual page
142 (qintdictiterator.3qt) and the Qt version (3.3.8).
143
144
145
146Trolltech AS 2 February 2007 QIntDictIterator(3qt)