3
3
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
4
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
<!-- /fasttmp/mkdist-qt-4.5.2-1245473805/qt-x11-opensource-src-4.5.2/doc/src/qiterator.qdoc -->
5
<!-- qiterator.qdoc -->
7
<title>Qt 4.5: QHashIterator Class Reference</title>
7
<title>Qt 4.6: QHashIterator Class Reference</title>
8
8
<link href="classic.css" rel="stylesheet" type="text/css" />
11
<a name="//apple_ref/cpp/cl//QHashIterator" />
11
12
<table border="0" cellpadding="0" cellspacing="0" width="100%">
13
<td align="left" valign="top" width="32"><a href="http://qtsoftware.com/products/qt"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
14
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="namespaces.html"><font color="#004faf">All Namespaces</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="mainclasses.html"><font color="#004faf">Main Classes</font></a> · <a href="groups.html"><font color="#004faf">Grouped Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a> · <a href="functions.html"><font color="#004faf">Functions</font></a></td>
15
<td align="right" valign="top" width="230"></td></tr></table><h1 class="title">QHashIterator Class Reference<br /><span class="small-subtitle">[<a href="qtcore.html">QtCore</a> module]</span>
14
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
15
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="functions.html"><font color="#004faf">All Functions</font></a> · <a href="overviews.html"><font color="#004faf">Overviews</font></a></td><td class="searchBar" align="right" valign="center"><form action="http://www.google.com/cse" id="cse-search-box"><div><input type="hidden" name="cx" value="000136343326384750312:dhbxnqlakyu" /><input type="hidden" name="ie" value="UTF-8" /><input type="text" name="q" size="31" /><input type="submit" name="sa" value="Search" /></div></form></td>
16
</tr></table><h1 class="title">QHashIterator Class Reference<br /><span class="small-subtitle">[<a href="qtcore.html">QtCore</a> module]</span>
17
18
<p>The QHashIterator class provides a Java-style const iterator for <a href="qhash.html">QHash</a> and <a href="qmultihash.html">QMultiHash</a>. <a href="#details">More...</a></p>
18
19
<pre> #include <QHashIterator></pre><ul>
19
20
<li><a href="qhashiterator-members.html">List of all members, including inherited members</a></li>
21
23
<a name="public-functions"></a>
22
<h3>Public Functions</h3>
24
<li><div class="fn"></div><b><a href="qhashiterator.html#QHashIterator">QHashIterator</a></b> ( const QHash<Key, T> & <i>hash</i> )</li>
25
<li><div class="fn"></div>bool <b><a href="qhashiterator.html#findNext">findNext</a></b> ( const T & <i>value</i> )</li>
26
<li><div class="fn"></div>bool <b><a href="qhashiterator.html#findPrevious">findPrevious</a></b> ( const T & <i>value</i> )</li>
27
<li><div class="fn"></div>bool <b><a href="qhashiterator.html#hasNext">hasNext</a></b> () const</li>
28
<li><div class="fn"></div>bool <b><a href="qhashiterator.html#hasPrevious">hasPrevious</a></b> () const</li>
29
<li><div class="fn"></div>const Key & <b><a href="qhashiterator.html#key">key</a></b> () const</li>
30
<li><div class="fn"></div>Item <b><a href="qhashiterator.html#next">next</a></b> ()</li>
31
<li><div class="fn"></div>Item <b><a href="qhashiterator.html#peekNext">peekNext</a></b> () const</li>
32
<li><div class="fn"></div>Item <b><a href="qhashiterator.html#peekPrevious">peekPrevious</a></b> () const</li>
33
<li><div class="fn"></div>Item <b><a href="qhashiterator.html#previous">previous</a></b> ()</li>
34
<li><div class="fn"></div>void <b><a href="qhashiterator.html#toBack">toBack</a></b> ()</li>
35
<li><div class="fn"></div>void <b><a href="qhashiterator.html#toFront">toFront</a></b> ()</li>
36
<li><div class="fn"></div>const T & <b><a href="qhashiterator.html#value">value</a></b> () const</li>
37
<li><div class="fn"></div>QHashIterator & <b><a href="qhashiterator.html#operator-eq">operator=</a></b> ( const QHash<Key, T> & <i>hash</i> )</li>
24
<h2>Public Functions</h2>
25
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
26
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qhashiterator.html#QHashIterator">QHashIterator</a></b> ( const QHash<Key, T> & <i>hash</i> )</td></tr>
27
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qhashiterator.html#findNext">findNext</a></b> ( const T & <i>value</i> )</td></tr>
28
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qhashiterator.html#findPrevious">findPrevious</a></b> ( const T & <i>value</i> )</td></tr>
29
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qhashiterator.html#hasNext">hasNext</a></b> () const</td></tr>
30
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qhashiterator.html#hasPrevious">hasPrevious</a></b> () const</td></tr>
31
<tr><td class="memItemLeft" align="right" valign="top">const Key & </td><td class="memItemRight" valign="bottom"><b><a href="qhashiterator.html#key">key</a></b> () const</td></tr>
32
<tr><td class="memItemLeft" align="right" valign="top">Item </td><td class="memItemRight" valign="bottom"><b><a href="qhashiterator.html#next">next</a></b> ()</td></tr>
33
<tr><td class="memItemLeft" align="right" valign="top">Item </td><td class="memItemRight" valign="bottom"><b><a href="qhashiterator.html#peekNext">peekNext</a></b> () const</td></tr>
34
<tr><td class="memItemLeft" align="right" valign="top">Item </td><td class="memItemRight" valign="bottom"><b><a href="qhashiterator.html#peekPrevious">peekPrevious</a></b> () const</td></tr>
35
<tr><td class="memItemLeft" align="right" valign="top">Item </td><td class="memItemRight" valign="bottom"><b><a href="qhashiterator.html#previous">previous</a></b> ()</td></tr>
36
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qhashiterator.html#toBack">toBack</a></b> ()</td></tr>
37
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qhashiterator.html#toFront">toFront</a></b> ()</td></tr>
38
<tr><td class="memItemLeft" align="right" valign="top">const T & </td><td class="memItemRight" valign="bottom"><b><a href="qhashiterator.html#value">value</a></b> () const</td></tr>
39
<tr><td class="memItemLeft" align="right" valign="top">QHashIterator & </td><td class="memItemRight" valign="bottom"><b><a href="qhashiterator.html#operator-eq">operator=</a></b> ( const QHash<Key, T> & <i>hash</i> )</td></tr>
39
41
<a name="details"></a>
41
43
<h2>Detailed Description</h2>
69
71
<p>See also <a href="qmutablehashiterator.html">QMutableHashIterator</a> and <a href="qhash-const-iterator.html">QHash::const_iterator</a>.</p>
71
73
<h2>Member Function Documentation</h2>
74
<a name="//apple_ref/cpp/instm/QHashIterator/QHashIterator" />
72
75
<h3 class="fn"><a name="QHashIterator"></a>QHashIterator::QHashIterator ( const <a href="qhash.html">QHash</a><Key, T> & <i>hash</i> )</h3>
73
76
<p>Constructs an iterator for traversing <i>hash</i>. The iterator is set to be at the front of the hash (before the first item).</p>
74
77
<p>See also <a href="qhashiterator.html#operator-eq">operator=</a>().</p>
78
<a name="//apple_ref/cpp/instm/QHashIterator/findNext" />
75
79
<h3 class="fn"><a name="findNext"></a>bool QHashIterator::findNext ( const T & <i>value</i> )</h3>
76
80
<p>Searches for <i>value</i> starting from the current iterator position forward. Returns true if a (key, value) pair with value <i>value</i> is found; otherwise returns false.</p>
77
81
<p>After the call, if <i>value</i> was found, the iterator is positioned just after the matching item; otherwise, the iterator is positioned at the back of the container.</p>
78
82
<p>See also <a href="qhashiterator.html#findPrevious">findPrevious</a>().</p>
83
<a name="//apple_ref/cpp/instm/QHashIterator/findPrevious" />
79
84
<h3 class="fn"><a name="findPrevious"></a>bool QHashIterator::findPrevious ( const T & <i>value</i> )</h3>
80
85
<p>Searches for <i>value</i> starting from the current iterator position backward. Returns true if a (key, value) pair with value <i>value</i> is found; otherwise returns false.</p>
81
86
<p>After the call, if <i>value</i> was found, the iterator is positioned just before the matching item; otherwise, the iterator is positioned at the front of the container.</p>
82
87
<p>See also <a href="qhashiterator.html#findNext">findNext</a>().</p>
88
<a name="//apple_ref/cpp/instm/QHashIterator/hasNext" />
83
89
<h3 class="fn"><a name="hasNext"></a>bool QHashIterator::hasNext () const</h3>
84
90
<p>Returns true if there is at least one item ahead of the iterator, i.e. the iterator is <i>not</i> at the back of the container; otherwise returns false.</p>
85
91
<p>See also <a href="qhashiterator.html#hasPrevious">hasPrevious</a>() and <a href="qhashiterator.html#next">next</a>().</p>
92
<a name="//apple_ref/cpp/instm/QHashIterator/hasPrevious" />
86
93
<h3 class="fn"><a name="hasPrevious"></a>bool QHashIterator::hasPrevious () const</h3>
87
94
<p>Returns true if there is at least one item behind the iterator, i.e. the iterator is <i>not</i> at the front of the container; otherwise returns false.</p>
88
95
<p>See also <a href="qhashiterator.html#hasNext">hasNext</a>() and <a href="qhashiterator.html#previous">previous</a>().</p>
96
<a name="//apple_ref/cpp/instm/QHashIterator/key" />
89
97
<h3 class="fn"><a name="key"></a>const Key & QHashIterator::key () const</h3>
90
98
<p>Returns the key of the last item that was jumped over using one of the traversal functions (<a href="qhashiterator.html#next">next</a>(), <a href="qhashiterator.html#previous">previous</a>(), <a href="qhashiterator.html#findNext">findNext</a>(), <a href="qhashiterator.html#findPrevious">findPrevious</a>()).</p>
91
99
<p>After a call to <a href="qhashiterator.html#next">next</a>() or <a href="qhashiterator.html#findNext">findNext</a>(), key() is equivalent to <a href="qhashiterator.html#peekPrevious">peekPrevious</a>().key(). After a call to <a href="qhashiterator.html#previous">previous</a>() or <a href="qhashiterator.html#findPrevious">findPrevious</a>(), key() is equivalent to <a href="qhashiterator.html#peekNext">peekNext</a>().key().</p>
92
100
<p>See also <a href="qhashiterator.html#value">value</a>().</p>
101
<a name="//apple_ref/cpp/instm/QHashIterator/next" />
93
102
<h3 class="fn"><a name="next"></a>Item QHashIterator::next ()</h3>
94
103
<p>Returns the next item and advances the iterator by one position.</p>
95
104
<p>Call <a href="qhashiterator.html#key">key</a>() on the return value to obtain the item's key, and <a href="qhashiterator.html#value">value</a>() to obtain the value.</p>
96
105
<p>Calling this function on an iterator located at the back of the container leads to undefined results.</p>
97
106
<p>See also <a href="qhashiterator.html#hasNext">hasNext</a>(), <a href="qhashiterator.html#peekNext">peekNext</a>(), and <a href="qhashiterator.html#previous">previous</a>().</p>
107
<a name="//apple_ref/cpp/instm/QHashIterator/peekNext" />
98
108
<h3 class="fn"><a name="peekNext"></a>Item QHashIterator::peekNext () const</h3>
99
109
<p>Returns the next item without moving the iterator.</p>
100
110
<p>Call <a href="qhashiterator.html#key">key</a>() on the return value to obtain the item's key, and <a href="qhashiterator.html#value">value</a>() to obtain the value.</p>
101
111
<p>Calling this function on an iterator located at the back of the container leads to undefined results.</p>
102
112
<p>See also <a href="qhashiterator.html#hasNext">hasNext</a>(), <a href="qhashiterator.html#next">next</a>(), and <a href="qhashiterator.html#peekPrevious">peekPrevious</a>().</p>
113
<a name="//apple_ref/cpp/instm/QHashIterator/peekPrevious" />
103
114
<h3 class="fn"><a name="peekPrevious"></a>Item QHashIterator::peekPrevious () const</h3>
104
115
<p>Returns the previous item without moving the iterator.</p>
105
116
<p>Call <a href="qhashiterator.html#key">key</a>() on the return value to obtain the item's key, and <a href="qhashiterator.html#value">value</a>() to obtain the value.</p>
106
117
<p>Calling this function on an iterator located at the front of the container leads to undefined results.</p>
107
118
<p>See also <a href="qhashiterator.html#hasPrevious">hasPrevious</a>(), <a href="qhashiterator.html#previous">previous</a>(), and <a href="qhashiterator.html#peekNext">peekNext</a>().</p>
119
<a name="//apple_ref/cpp/instm/QHashIterator/previous" />
108
120
<h3 class="fn"><a name="previous"></a>Item QHashIterator::previous ()</h3>
109
121
<p>Returns the previous item and moves the iterator back by one position.</p>
110
122
<p>Call <a href="qhashiterator.html#key">key</a>() on the return value to obtain the item's key, and <a href="qhashiterator.html#value">value</a>() to obtain the value.</p>
111
123
<p>Calling this function on an iterator located at the front of the container leads to undefined results.</p>
112
124
<p>See also <a href="qhashiterator.html#hasPrevious">hasPrevious</a>(), <a href="qhashiterator.html#peekPrevious">peekPrevious</a>(), and <a href="qhashiterator.html#next">next</a>().</p>
125
<a name="//apple_ref/cpp/instm/QHashIterator/toBack" />
113
126
<h3 class="fn"><a name="toBack"></a>void QHashIterator::toBack ()</h3>
114
127
<p>Moves the iterator to the back of the container (after the last item).</p>
115
128
<p>See also <a href="qhashiterator.html#toFront">toFront</a>() and <a href="qhashiterator.html#previous">previous</a>().</p>
129
<a name="//apple_ref/cpp/instm/QHashIterator/toFront" />
116
130
<h3 class="fn"><a name="toFront"></a>void QHashIterator::toFront ()</h3>
117
131
<p>Moves the iterator to the front of the container (before the first item).</p>
118
132
<p>See also <a href="qhashiterator.html#toBack">toBack</a>() and <a href="qhashiterator.html#next">next</a>().</p>
133
<a name="//apple_ref/cpp/instm/QHashIterator/value" />
119
134
<h3 class="fn"><a name="value"></a>const T & QHashIterator::value () const</h3>
120
135
<p>Returns the value of the last item that was jumped over using one of the traversal functions (<a href="qhashiterator.html#next">next</a>(), <a href="qhashiterator.html#previous">previous</a>(), <a href="qhashiterator.html#findNext">findNext</a>(), <a href="qhashiterator.html#findPrevious">findPrevious</a>()).</p>
121
136
<p>After a call to <a href="qhashiterator.html#next">next</a>() or <a href="qhashiterator.html#findNext">findNext</a>(), value() is equivalent to <a href="qhashiterator.html#peekPrevious">peekPrevious</a>().value(). After a call to <a href="qhashiterator.html#previous">previous</a>() or <a href="qhashiterator.html#findPrevious">findPrevious</a>(), value() is equivalent to <a href="qhashiterator.html#peekNext">peekNext</a>().value().</p>
122
137
<p>See also <a href="qhashiterator.html#key">key</a>().</p>
138
<a name="//apple_ref/cpp/instm/QHashIterator/operator=" />
123
139
<h3 class="fn"><a name="operator-eq"></a>QHashIterator & QHashIterator::operator= ( const <a href="qhash.html">QHash</a><Key, T> & <i>hash</i> )</h3>
124
140
<p>Makes the iterator operate on <i>hash</i>. The iterator is set to be at the front of the hash (before the first item).</p>
125
141
<p>See also <a href="qhashiterator.html#toFront">toFront</a>() and <a href="qhashiterator.html#toBack">toBack</a>().</p>
126
142
<p /><address><hr /><div align="center">
127
143
<table width="100%" cellspacing="0" border="0"><tr class="address">
128
<td width="30%" align="left">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies)</td>
129
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
130
<td width="30%" align="right"><div align="right">Qt 4.5.2</div></td>
131
</tr></table></div></address></body>
144
<td width="40%" align="left">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies)</td>
145
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
146
<td width="40%" align="right"><div align="right">Qt 4.6.0</div></td>
147
<script type="text/javascript" src="http://www.google.com/jsapi"></script><script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script><script type="text/javascript" src="http://www.google.com/coop/cse/t13n?form=cse-search-box&t13n_langs=en"></script><script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script></tr></table></div></address></body>