File: qglist.html

package info (click to toggle)
qt-embedded 2.3.2-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 68,608 kB
  • ctags: 45,998
  • sloc: cpp: 276,654; ansic: 71,987; makefile: 29,074; sh: 12,305; yacc: 2,465; python: 1,863; perl: 481; lex: 480; xml: 68; lisp: 15
file content (230 lines) | stat: -rw-r--r-- 15,071 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Qt Toolkit - QGList Class</title><style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }body { background: white; color: black; }
--></style>
</head><body bgcolor="#ffffff">

<table width="100%">
<tr><td><a href="index.html">
<img width="100" height="100" src="qtlogo.png"
alt="Home" border="0"><img width="100"
height="100" src="face.png" alt="Home" border="0">
</a><td valign=top><div align=right><img src="dochead.png" width="472" height="27"><br>
<a href="classes.html"><b>Classes</b></a>
-<a href="annotated.html">Annotated</a>
- <a href="hierarchy.html">Tree</a>
-<a href="functions.html">Functions</a>
-<a href="index.html">Home</a>
-<a href="topicals.html"><b>Structure</b></a>
</div>
</table>

<h1 align=center>QGList Class Reference</h1><br clear="all">
<p>
The QGList class is an internal class for implementing Qt collection classes.
<a href="#details">More...</a>
<p>
<code>#include &lt;<a href="qglist-h.html">qglist.h</a>&gt;</code>
<p>
Inherits <a href="qcollection.html">QCollection</a>.
<p>Inherited by <a href="qlist.html">QList</a>, <a href="qqueue.html">QQueue</a> and <a href="qstack.html">QStack</a>.
<p><a href="qglist-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class="fn">virtualuint<b>count</b>()const(internal)</div>
<li><div class="fn">QDataStream&amp;<b>read</b>(QDataStream&amp;)(internal)</div>
<li><div class="fn">QDataStream&amp;<b>write</b>(QDataStream&amp;)const(internal)</div>
</ul>
<h2>Protected Members</h2>
<ul>
<li><div class="fn"><b>QGList</b>()(internal)</div>
<li><div class="fn"><b>QGList</b>(constQGList&amp;)(internal)</div>
<li><div class="fn">virtual<b>~QGList</b>()(internal)</div>
<li><div class="fn">QGList&amp;<b>operator=</b>(constQGList&amp;)(internal)</div>
<li><div class="fn">bool<a href="#a25833"><b>operator==</b></a>(constQGList&amp;)const</div>
<li><div class="fn">void<b>inSort</b>(QCollection::Item)(internal)</div>
<li><div class="fn">void<b>append</b>(QCollection::Item)(internal)</div>
<li><div class="fn">bool<b>insertAt</b>(uintindex, QCollection::Item)(internal)</div>
<li><div class="fn">void<b>relinkNode</b>(QLNode*)(internal)</div>
<li><div class="fn">bool<b>removeNode</b>(QLNode*)(internal)</div>
<li><div class="fn">bool<b>remove</b>(QCollection::Item=0)(internal)</div>
<li><div class="fn">bool<b>removeRef</b>(QCollection::Item=0)(internal)</div>
<li><div class="fn">bool<b>removeFirst</b>()(internal)</div>
<li><div class="fn">bool<b>removeLast</b>()(internal)</div>
<li><div class="fn">bool<b>removeAt</b>(uintindex)(internal)</div>
<li><div class="fn">QCollection::Item<b>takeNode</b>(QLNode*)(internal)</div>
<li><div class="fn">QCollection::Item<b>take</b>()(internal)</div>
<li><div class="fn">QCollection::Item<b>takeAt</b>(uintindex)(internal)</div>
<li><div class="fn">QCollection::Item<b>takeFirst</b>()(internal)</div>
<li><div class="fn">QCollection::Item<b>takeLast</b>()(internal)</div>
<li><div class="fn">void<a href="#e57467"><b>sort</b></a>()</div>
<li><div class="fn">virtualvoid<b>clear</b>()(internal)</div>
<li><div class="fn">int<b>findRef</b>(QCollection::Item, bool=TRUE)(internal)</div>
<li><div class="fn">int<b>find</b>(QCollection::Item, bool=TRUE)(internal)</div>
<li><div class="fn">uint<b>containsRef</b>(QCollection::Item)const(internal)</div>
<li><div class="fn">uint<b>contains</b>(QCollection::Item)const(internal)</div>
<li><div class="fn">QCollection::Item<b>at</b>(uintindex)(internal)</div>
<li><div class="fn">int<b>at</b>()const(internal)</div>
<li><div class="fn">QLNode*<b>currentNode</b>()const(internal)</div>
<li><div class="fn">QCollection::Item<b>get</b>()const(internal)</div>
<li><div class="fn">QCollection::Item<b>cfirst</b>()const(internal)</div>
<li><div class="fn">QCollection::Item<b>clast</b>()const(internal)</div>
<li><div class="fn">QCollection::Item<b>first</b>()(internal)</div>
<li><div class="fn">QCollection::Item<b>last</b>()(internal)</div>
<li><div class="fn">QCollection::Item<b>next</b>()(internal)</div>
<li><div class="fn">QCollection::Item<b>prev</b>()(internal)</div>
<li><div class="fn">void<b>toVector</b>(QGVector*)const(internal)</div>
<li><div class="fn">virtualint<a href="#f2a675"><b>compareItems</b></a>(QCollection::Item, QCollection::Item)</div>
<li><div class="fn">virtualQDataStream&amp;<a href="#1da888"><b>read</b></a>(QDataStream&amp;, QCollection::Item&amp;)</div>
<li><div class="fn">virtualQDataStream&amp;<a href="#a7db4d"><b>write</b></a>(QDataStream&amp;, QCollection::Item)const</div>
</ul>
<hr><h2><a name="details"></a>Detailed Description</h2>
The QGList class is an internal class for implementing Qt collection classes.
<p>
QGList is a strictly internal class that acts as a base class for several
<a href="collection.html">collection classes</a>; <a href="qlist.html">QList</a>, <a href="qqueue.html">QQueue</a> and
<a href="qstack.html">QStack</a>.
<p>QGList has some virtual functions that can be reimplemented to customize
the subclasses.
<ul>
<li> <a href="#f2a675">compareItems</a>() compares two collection/list items.
<li> <a href="#1da888">read</a>() reads a collection/list item from a <a href="qdatastream.html">QDataStream</a>.
<li> <a href="#9fe4e7">write</a>() writes a collection/list item to a QDataStream.
</ul>
Normally, you do not have to reimplement any of these functions.
If you still want to reimplement them, see the <a href="qstrlist.html">QStrList</a> class (<a href="qstrlist-h.html">qstrlist.h</a>),
which is a good example.

<hr><h2>Member Function Documentation</h2>
<h3 class="fn">int<a name="f2a675"></a>QGList::compareItems(<a href="qcollection.html#Item">QCollection::Item</a>item1, <a href="qcollection.html#Item">QCollection::Item</a>item2) <code>[virtualprotected]</code></h3>
<p>This virtual function compares two list items.
<p>Returns:
<ul>
<li> 0 if <em>item1</em> == <em>item2</em>
<li> non-zero if <em>item1</em> != <em>item2</em>
</ul>
<p>This function returns <em>int</em> rather than <em>bool</em> so that
reimplementations can return three values and use it to sort by:
<p><ul>
<li> 0 if <em>item1</em> == <em>item2</em>
<li> &gt; 0 (positive integer) if <em>item1</em> &gt; <em>item2</em>
<li> &lt; 0 (negative integer) if <em>item1</em> &lt; <em>item2</em>
</ul>
<p>The <a href="qlist.html#bf9354">QList::inSort</a>() function requires that compareItems() is implemented
as described here.
<p>This function should not modify the list because some const functions
call compareItems().
<p>The default implementation compares the pointers:
<pre></pre>
<h3 class="fn">bool<a name="a25833"></a>QGList::operator==(constQGList&amp;list)const <code>[protected]</code></h3>
<p>Compares this list with <em>list.</em> Retruns TRUE if the lists
contain the same data, else FALSE.
<h3 class="fn"><a href="qdatastream.html">QDataStream</a>&amp;<a name="1da888"></a>QGList::read(<a href="qdatastream.html">QDataStream</a>&amp;s, <a href="qcollection.html#Item">QCollection::Item</a>&amp;item) <code>[virtualprotected]</code></h3>
<p>Reads a collection/list item from the stream <em>s</em> and returns a reference
to the stream.
<p>The default implementation sets <em>item</em> to 0.
<p>See also  <a href="#9fe4e7">write</a>().
<h3 class="fn">void<a name="e57467"></a>QGList::sort() <code>[protected]</code></h3>
<p>Sorts the list by the result of the virtual <a href="#f2a675">compareItems</a>() function.
<p>The Heap-Sort algorithm is used for sorting.  It sorts <a href="n.html">n</a> items with
O(n*log n) compares.  This is the asymptotic optimal solution of the
sorting problem.
<h3 class="fn"><a href="qdatastream.html">QDataStream</a>&amp;<a name="a7db4d"></a>QGList::write(<a href="qdatastream.html">QDataStream</a>&amp;s, <a href="qcollection.html#Item">QCollection::Item</a>)const <code>[virtualprotected]</code></h3>
<p>Writes a collection/list item to the stream <em>s</em> and returns a reference
to the stream.
<p>The default implementation does nothing.
<p>See also  <a href="#1da888">read</a>().
<h3 class="fn"><a name="145d4e"></a>QGList::QGList() <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn"><a name="e9f7df"></a>QGList::QGList(constQGList&amp;list) <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn"><a name="d9a7fd"></a>QGList::~QGList() <code>[virtualprotected]</code></h3>
<p>For internal use only.
<h3 class="fn">void<a name="0da4de"></a>QGList::append(<a href="qcollection.html#Item">QCollection::Item</a>d) <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">QCollection::Item<a name="011a20"></a>QGList::at(uintindex) <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">int<a name="20e86d"></a>QGList::at()const <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">QCollection::Item<a name="7668bc"></a>QGList::cfirst()const <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">QCollection::Item<a name="db853e"></a>QGList::clast()const <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">void<a name="cb5158"></a>QGList::clear() <code>[virtualprotected]</code></h3>
<p>For internal use only.
<p>Reimplemented from <a href="qcollection.html#e9c603">QCollection.</a>
<h3 class="fn">uint<a name="d85ba8"></a>QGList::contains(<a href="qcollection.html#Item">QCollection::Item</a>d)const <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">uint<a name="8dada9"></a>QGList::containsRef(<a href="qcollection.html#Item">QCollection::Item</a>d)const <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">uint<a name="c18536"></a>QGList::count()const <code>[virtual]</code></h3>
<p>For internal use only.
<p>Reimplemented from <a href="qcollection.html#2213fa">QCollection.</a>
<h3 class="fn"><a href="qlnode.html">QLNode</a>*<a name="59c873"></a>QGList::currentNode()const <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">int<a name="84b501"></a>QGList::find(<a href="qcollection.html#Item">QCollection::Item</a>d, boolfromStart=TRUE) <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">int<a name="5387bd"></a>QGList::findRef(<a href="qcollection.html#Item">QCollection::Item</a>d, boolfromStart=TRUE) <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">QCollection::Item<a name="c8a4b5"></a>QGList::first() <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">QCollection::Item<a name="50a8c5"></a>QGList::get()const <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">void<a name="b9872d"></a>QGList::inSort(<a href="qcollection.html#Item">QCollection::Item</a>d) <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">bool<a name="5fab4d"></a>QGList::insertAt(uintindex, <a href="qcollection.html#Item">QCollection::Item</a>d) <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">QCollection::Item<a name="a0e9ad"></a>QGList::last() <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">QCollection::Item<a name="8fa8dd"></a>QGList::next() <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">QGList&amp;<a name="75eaa5"></a>QGList::operator=(constQGList&amp;list) <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">QCollection::Item<a name="39f63e"></a>QGList::prev() <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn"><a href="qdatastream.html">QDataStream</a>&amp;<a name="a161e3"></a>QGList::read(<a href="qdatastream.html">QDataStream</a>&amp;s)</h3>
<p>For internal use only.
<h3 class="fn">void<a name="03dca1"></a>QGList::relinkNode(<a href="qlnode.html">QLNode</a>*<a href="n.html">n</a>) <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">bool<a name="757281"></a>QGList::remove(<a href="qcollection.html#Item">QCollection::Item</a>d=0) <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">bool<a name="aa752a"></a>QGList::removeAt(uintindex) <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">bool<a name="68d700"></a>QGList::removeFirst() <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">bool<a name="70f942"></a>QGList::removeLast() <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">bool<a name="3a8e26"></a>QGList::removeNode(<a href="qlnode.html">QLNode</a>*<a href="n.html">n</a>) <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">bool<a name="c792d8"></a>QGList::removeRef(<a href="qcollection.html#Item">QCollection::Item</a>d=0) <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">QCollection::Item<a name="4fcf30"></a>QGList::take() <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">QCollection::Item<a name="b21257"></a>QGList::takeAt(uintindex) <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">QCollection::Item<a name="b37f2c"></a>QGList::takeFirst() <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">QCollection::Item<a name="bde921"></a>QGList::takeLast() <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">QCollection::Item<a name="d8d5ad"></a>QGList::takeNode(QLNode*n) <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn">void<a name="39c36c"></a>QGList::toVector(<a href="qgvector.html">QGVector</a>*vector)const <code>[protected]</code></h3>
<p>For internal use only.
<h3 class="fn"><a href="qdatastream.html">QDataStream</a>&amp;<a name="9fe4e7"></a>QGList::write(<a href="qdatastream.html">QDataStream</a>&amp;s)const</h3>
<p>For internal use only.
<hr><p>
Search the documentation, FAQ, qt-interest archive and more (uses
<a href="http://www.trolltech.com">www.trolltech.com</a>):<br>
<form method=post action="http://www.trolltech.com/search.cgi">
<input type=hidden name="version" value="2.3.2"><nobr>
<input size="50" name="search"><input type=submit value="Search">
</nobr></form><hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>,
copyright &copy; 1995-2001
<a href="http://www.trolltech.com">Trolltech</a>, all rights reserved.<p><address><hr><div align="center">
<table width="100%" cellspacing="0" border="0"><tr>
<td>Copyright  2001 Trolltech<td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align="right"><div align="right">Qt version 2.3.2</div>
</table></div></address></body></html>