[190] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
| 2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/doc/qintdict.doc:314 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>QIntDictIterator Class</title>
|
---|
| 7 | <style type="text/css"><!--
|
---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
| 9 | a:link { color: #004faf; text-decoration: none }
|
---|
| 10 | a:visited { color: #672967; text-decoration: none }
|
---|
| 11 | body { background: #ffffff; color: black; }
|
---|
| 12 | --></style>
|
---|
| 13 | </head>
|
---|
| 14 | <body>
|
---|
| 15 |
|
---|
| 16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
| 17 | <tr bgcolor="#E5E5E5">
|
---|
| 18 | <td valign=center>
|
---|
| 19 | <a href="index.html">
|
---|
| 20 | <font color="#004faf">Home</font></a>
|
---|
| 21 | | <a href="classes.html">
|
---|
| 22 | <font color="#004faf">All Classes</font></a>
|
---|
| 23 | | <a href="mainclasses.html">
|
---|
| 24 | <font color="#004faf">Main Classes</font></a>
|
---|
| 25 | | <a href="annotated.html">
|
---|
| 26 | <font color="#004faf">Annotated</font></a>
|
---|
| 27 | | <a href="groups.html">
|
---|
| 28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
| 29 | | <a href="functions.html">
|
---|
| 30 | <font color="#004faf">Functions</font></a>
|
---|
| 31 | </td>
|
---|
| 32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QIntDictIterator Class Reference</h1>
|
---|
| 33 |
|
---|
| 34 | <p>The QIntDictIterator class provides an iterator for QIntDict collections.
|
---|
| 35 | <a href="#details">More...</a>
|
---|
| 36 | <p><tt>#include <<a href="qintdict-h.html">qintdict.h</a>></tt>
|
---|
| 37 | <p><a href="qintdictiterator-members.html">List of all member functions.</a>
|
---|
| 38 | <h2>Public Members</h2>
|
---|
| 39 | <ul>
|
---|
| 40 | <li class=fn><a href="#QIntDictIterator"><b>QIntDictIterator</b></a> ( const QIntDict<type> & dict )</li>
|
---|
| 41 | <li class=fn><a href="#~QIntDictIterator"><b>~QIntDictIterator</b></a> ()</li>
|
---|
| 42 | <li class=fn>uint <a href="#count"><b>count</b></a> () const</li>
|
---|
| 43 | <li class=fn>bool <a href="#isEmpty"><b>isEmpty</b></a> () const</li>
|
---|
| 44 | <li class=fn>type * <a href="#toFirst"><b>toFirst</b></a> ()</li>
|
---|
| 45 | <li class=fn><a href="#operator-type-*"><b>operator type *</b></a> () const</li>
|
---|
| 46 | <li class=fn>type * <a href="#current"><b>current</b></a> () const</li>
|
---|
| 47 | <li class=fn>long <a href="#currentKey"><b>currentKey</b></a> () const</li>
|
---|
| 48 | <li class=fn>type * <a href="#operator()"><b>operator()</b></a> ()</li>
|
---|
| 49 | <li class=fn>type * <a href="#operator++"><b>operator++</b></a> ()</li>
|
---|
| 50 | <li class=fn>type * <a href="#operator+-eq"><b>operator+=</b></a> ( uint jump )</li>
|
---|
| 51 | </ul>
|
---|
| 52 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
| 53 |
|
---|
| 54 |
|
---|
| 55 | The QIntDictIterator class provides an iterator for <a href="qintdict.html">QIntDict</a> collections.
|
---|
| 56 | <p>
|
---|
| 57 |
|
---|
| 58 | <p> QIntDictIterator is implemented as a template class. Define a
|
---|
| 59 | template instance QIntDictIterator<X> to create a dictionary
|
---|
| 60 | iterator that operates on QIntDict<X> (dictionary of X*).
|
---|
| 61 | <p> Example:
|
---|
| 62 | <pre>
|
---|
| 63 | <a href="qintdict.html">QIntDict</a><QLineEdit> fields;
|
---|
| 64 | for ( int i = 0; i < 3; i++ )
|
---|
| 65 | fields.<a href="qintdict.html#insert">insert</a>( i, new <a href="qlineedit.html">QLineEdit</a>( this ) );
|
---|
| 66 |
|
---|
| 67 | fields[0]->setText( "Homer" );
|
---|
| 68 | fields[1]->setText( "Simpson" );
|
---|
| 69 | fields[2]->setText( "45" );
|
---|
| 70 |
|
---|
| 71 | QIntDictIterator<QLineEdit> it( fields );
|
---|
| 72 | for ( ; it.<a href="#current">current</a>(); ++it )
|
---|
| 73 | cout << it.<a href="#currentKey">currentKey</a>() << ": " << it.<a href="#current">current</a>()->text() << endl;
|
---|
| 74 |
|
---|
| 75 | // Output (random order):
|
---|
| 76 | // 0: Homer
|
---|
| 77 | // 1: Simpson
|
---|
| 78 | // 2: 45
|
---|
| 79 | </pre>
|
---|
| 80 |
|
---|
| 81 | <p> Note that the traversal order is arbitrary; you are not guaranteed the
|
---|
| 82 | order shown above.
|
---|
| 83 | <p> Multiple iterators may independently traverse the same dictionary.
|
---|
| 84 | A <a href="qintdict.html">QIntDict</a> knows about all the iterators that are operating on the
|
---|
| 85 | dictionary. When an item is removed from the dictionary, QIntDict
|
---|
| 86 | updates all iterators that refer the removed item to point to the
|
---|
| 87 | next item in the traversal order.
|
---|
| 88 | <p> <p>See also <a href="qintdict.html">QIntDict</a>, <a href="collection.html">Collection Classes</a>, and <a href="tools.html">Non-GUI Classes</a>.
|
---|
| 89 |
|
---|
| 90 | <hr><h2>Member Function Documentation</h2>
|
---|
| 91 | <h3 class=fn><a name="QIntDictIterator"></a>QIntDictIterator::QIntDictIterator ( const <a href="qintdict.html">QIntDict</a><type> & dict )
|
---|
| 92 | </h3>
|
---|
| 93 |
|
---|
| 94 | <p> Constructs an iterator for <em>dict</em>. The current iterator item is
|
---|
| 95 | set to point to the 'first' item in the <em>dict</em>. The first item
|
---|
| 96 | refers to the first item in the dictionary's arbitrary internal
|
---|
| 97 | ordering.
|
---|
| 98 |
|
---|
| 99 | <h3 class=fn><a name="~QIntDictIterator"></a>QIntDictIterator::~QIntDictIterator ()
|
---|
| 100 | </h3>
|
---|
| 101 |
|
---|
| 102 | <p> Destroys the iterator.
|
---|
| 103 |
|
---|
| 104 | <h3 class=fn>uint <a name="count"></a>QIntDictIterator::count () const
|
---|
| 105 | </h3>
|
---|
| 106 |
|
---|
| 107 | <p> Returns the number of items in the dictionary this iterator
|
---|
| 108 | operates over.
|
---|
| 109 | <p> <p>See also <a href="#isEmpty">isEmpty</a>().
|
---|
| 110 |
|
---|
| 111 | <h3 class=fn>type * <a name="current"></a>QIntDictIterator::current () const
|
---|
| 112 | </h3>
|
---|
| 113 |
|
---|
| 114 | <p> Returns a pointer to the current iterator item.
|
---|
| 115 |
|
---|
| 116 | <h3 class=fn>long <a name="currentKey"></a>QIntDictIterator::currentKey () const
|
---|
| 117 | </h3>
|
---|
| 118 |
|
---|
| 119 | <p> Returns the key for the current iterator item.
|
---|
| 120 |
|
---|
| 121 | <h3 class=fn>bool <a name="isEmpty"></a>QIntDictIterator::isEmpty () const
|
---|
| 122 | </h3>
|
---|
| 123 |
|
---|
| 124 | <p> Returns TRUE if the dictionary is empty; otherwise eturns FALSE.
|
---|
| 125 | <p> <p>See also <a href="#count">count</a>().
|
---|
| 126 |
|
---|
| 127 | <h3 class=fn><a name="operator-type-*"></a>QIntDictIterator::operator type * () const
|
---|
| 128 | </h3>
|
---|
| 129 |
|
---|
| 130 | <p> Cast operator. Returns a pointer to the current iterator item.
|
---|
| 131 | Same as <a href="#current">current</a>().
|
---|
| 132 |
|
---|
| 133 | <h3 class=fn>type * <a name="operator()"></a>QIntDictIterator::operator() ()
|
---|
| 134 | </h3>
|
---|
| 135 |
|
---|
| 136 | <p> Makes the succeeding item current and returns the original current
|
---|
| 137 | item.
|
---|
| 138 | <p> If the current iterator item was the last item in the dictionary
|
---|
| 139 | or if it was 0, 0 is returned.
|
---|
| 140 |
|
---|
| 141 | <h3 class=fn>type * <a name="operator++"></a>QIntDictIterator::operator++ ()
|
---|
| 142 | </h3>
|
---|
| 143 |
|
---|
| 144 | <p> Prefix ++ makes the succeeding item current and returns the new
|
---|
| 145 | current item.
|
---|
| 146 | <p> If the current iterator item was the last item in the dictionary
|
---|
| 147 | or if it was 0, 0 is returned.
|
---|
| 148 |
|
---|
| 149 | <h3 class=fn>type * <a name="operator+-eq"></a>QIntDictIterator::operator+= ( uint jump )
|
---|
| 150 | </h3>
|
---|
| 151 |
|
---|
| 152 | <p> Sets the current item to the item <em>jump</em> positions after the
|
---|
| 153 | current item, and returns a pointer to that item.
|
---|
| 154 | <p> If that item is beyond the last item or if the dictionary is
|
---|
| 155 | empty, it sets the current item to 0 and returns 0.
|
---|
| 156 |
|
---|
| 157 | <h3 class=fn>type * <a name="toFirst"></a>QIntDictIterator::toFirst ()
|
---|
| 158 | </h3>
|
---|
| 159 |
|
---|
| 160 | <p> Sets the current iterator item to point to the first item in the
|
---|
| 161 | dictionary and returns a pointer to the item. The first item
|
---|
| 162 | refers to the first item in the dictionary's arbitrary internal
|
---|
| 163 | ordering. If the dictionary is empty it sets the current item to
|
---|
| 164 | 0 and returns 0.
|
---|
| 165 |
|
---|
| 166 | <!-- eof -->
|
---|
| 167 | <hr><p>
|
---|
| 168 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
| 169 | Copyright © 1995-2007
|
---|
| 170 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
| 171 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 172 | <td>Copyright © 2007
|
---|
| 173 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 174 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 175 | </table></div></address></body>
|
---|
| 176 | </html>
|
---|