1
<?xml version="1.0" encoding="iso-8859-1"?>
3
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/doc/src/q3intdict.qdoc -->
7
<title>Qt 4.0: Q3IntDictIterator Class Reference</title>
8
<style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
9
a:link { color: #004faf; text-decoration: none }
10
a:visited { color: #672967; text-decoration: none }
11
td.postheader { font-family: sans-serif }
12
tr.address { font-family: sans-serif }
13
body { background: #ffffff; color: black; }</style>
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
19
<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="mainclasses.html"><font color="#004faf">Main Classes</font></a> · <a href="annotated.html"><font color="#004faf">Annotated</font></a> · <a href="groups.html"><font color="#004faf">Grouped Classes</font></a> · <a href="functions.html"><font color="#004faf">Functions</font></a></td>
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">Q3IntDictIterator Class Reference</h1>
21
<p>The Q3IntDictIterator class provides an iterator for <a href="q3intdict.html">Q3IntDict</a> collections. <a href="#details">More...</a></p>
22
<pre>#include <Q3IntDictIterator></pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See the <a href="porting4.html">Porting Guide</a> for more information.</p>
23
<p>Part of the <a href="qt3support.html">Qt3Support</a> module.</p>
25
<li><a href="q3intdictiterator-members.html">List of all members, including inherited members</a></li>
27
<a name="public-functions"></a>
28
<h3>Public Functions</h3>
30
<li><div class="fn"/><b><a href="q3intdictiterator.html#Q3IntDictIterator">Q3IntDictIterator</a></b> ( const Q3IntDict<type> & <i>dict</i> )</li>
31
<li><div class="fn"/><b><a href="q3intdictiterator.html#dtor.Q3IntDictIterator">~Q3IntDictIterator</a></b> ()</li>
32
<li><div class="fn"/>uint <b><a href="q3intdictiterator.html#count">count</a></b> () const</li>
33
<li><div class="fn"/>type * <b><a href="q3intdictiterator.html#current">current</a></b> () const</li>
34
<li><div class="fn"/>long <b><a href="q3intdictiterator.html#currentKey">currentKey</a></b> () const</li>
35
<li><div class="fn"/>bool <b><a href="q3intdictiterator.html#isEmpty">isEmpty</a></b> () const</li>
36
<li><div class="fn"/>type * <b><a href="q3intdictiterator.html#toFirst">toFirst</a></b> ()</li>
37
<li><div class="fn"/><b><a href="q3intdictiterator.html#operator-type--2a">operator type *</a></b> () const</li>
38
<li><div class="fn"/>type * <b><a href="q3intdictiterator.html#operator-28-29">operator()</a></b> ()</li>
39
<li><div class="fn"/>type * <b><a href="q3intdictiterator.html#operator-2b-2b">operator++</a></b> ()</li>
40
<li><div class="fn"/>type * <b><a href="q3intdictiterator.html#operator-2b-eq">operator+=</a></b> ( uint <i>jump</i> )</li>
42
<a name="details"></a>
44
<h2>Detailed Description</h2>
45
<p>The Q3IntDictIterator class provides an iterator for <a href="q3intdict.html">Q3IntDict</a> collections.</p>
46
<p>Q3IntDictIterator is implemented as a template class. Define a template instance Q3IntDictIterator<X> to create a dictionary iterator that operates on <a href="q3intdict.html">Q3IntDict</a><X> (dictionary of X*).</p>
48
<pre> Q3IntDict<QLineEdit> fields;
49
for ( int i = 0; i < 3; i++ )
50
fields.insert( i, new QLineEdit( this ) );
52
fields[0]->setText( "Homer" );
53
fields[1]->setText( "Simpson" );
54
fields[2]->setText( "45" );
56
Q3IntDictIterator<QLineEdit> it( fields );
57
for ( ; it.current(); ++it )
58
cout << it.currentKey() << ": " << it.current()->text() << endl;
60
// Output (random order):
64
<p>Note that the traversal order is arbitrary; you are not guaranteed the order shown above.</p>
65
<p>Multiple iterators may independently traverse the same dictionary. A <a href="q3intdict.html">Q3IntDict</a> knows about all the iterators that are operating on the dictionary. When an item is removed from the dictionary, <a href="q3intdict.html">Q3IntDict</a> updates all iterators that refer the removed item to point to the next item in the traversal order.</p>
66
<p>See also <a href="q3intdict.html">Q3IntDict</a>.</p>
68
<h2>Member Function Documentation</h2>
69
<h3 class="fn"><a name="Q3IntDictIterator"></a>Q3IntDictIterator::Q3IntDictIterator ( const <a href="q3intdict.html">Q3IntDict</a><type> & <i>dict</i> )</h3>
70
<p>Constructs an iterator for <i>dict</i>. The current iterator item is set to point to the 'first' item in the <i>dict</i>. The first item refers to the first item in the dictionary's arbitrary internal ordering.</p>
71
<h3 class="fn"><a name="dtor.Q3IntDictIterator"></a>Q3IntDictIterator::~Q3IntDictIterator ()</h3>
72
<p>Destroys the iterator.</p>
73
<h3 class="fn"><a name="count"></a><a href="qtglobal.html#uint-typedef">uint</a> Q3IntDictIterator::count () const</h3>
74
<p>Returns the number of items in the dictionary this iterator operates over.</p>
75
<p>See also <a href="q3intdictiterator.html#isEmpty">isEmpty</a>().</p>
76
<h3 class="fn"><a name="current"></a>type * Q3IntDictIterator::current () const</h3>
77
<p>Returns a pointer to the current iterator item.</p>
78
<h3 class="fn"><a name="currentKey"></a>long Q3IntDictIterator::currentKey () const</h3>
79
<p>Returns the key for the current iterator item.</p>
80
<h3 class="fn"><a name="isEmpty"></a>bool Q3IntDictIterator::isEmpty () const</h3>
81
<p>Returns TRUE if the dictionary is empty; otherwise eturns FALSE.</p>
82
<p>See also <a href="q3intdictiterator.html#count">count</a>().</p>
83
<h3 class="fn"><a name="toFirst"></a>type * Q3IntDictIterator::toFirst ()</h3>
84
<p>Sets the current iterator item to point to the first item in the dictionary and returns a pointer to the item. The first item refers to the first item in the dictionary's arbitrary internal ordering. If the dictionary is empty it sets the current item to 0 and returns 0.</p>
85
<h3 class="fn"><a name="operator-type--2a"></a>Q3IntDictIterator::operator type * () const</h3>
86
<p>Cast operator. Returns a pointer to the current iterator item. Same as <a href="q3intdictiterator.html#current">current</a>().</p>
87
<h3 class="fn"><a name="operator-28-29"></a>type * Q3IntDictIterator::operator() ()</h3>
88
<p>Makes the succeeding item current and returns the original current item.</p>
89
<p>If the current iterator item was the last item in the dictionary or if it was 0, 0 is returned.</p>
90
<h3 class="fn"><a name="operator-2b-2b"></a>type * Q3IntDictIterator::operator++ ()</h3>
91
<p>Prefix ++ makes the succeeding item current and returns the new current item.</p>
92
<p>If the current iterator item was the last item in the dictionary or if it was 0, 0 is returned.</p>
93
<h3 class="fn"><a name="operator-2b-eq"></a>type * Q3IntDictIterator::operator+= ( <a href="qtglobal.html#uint-typedef">uint</a> <i>jump</i> )</h3>
94
<p>Sets the current item to the item <i>jump</i> positions after the current item, and returns a pointer to that item.</p>
95
<p>If that item is beyond the last item or if the dictionary is empty, it sets the current item to 0 and returns 0.</p>
96
<p /><address><hr /><div align="center">
97
<table width="100%" cellspacing="0" border="0"><tr class="address">
98
<td width="30%">Copyright © 2005 <a href="trolltech.html">Trolltech</a></td>
99
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
100
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
101
</tr></table></div></address></body>