~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/q3ptrlist.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html
 
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/q3ptrlist.qdoc -->
 
6
<head>
 
7
    <title>Qt 4.0: Q3PtrList 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>
 
14
</head>
 
15
<body>
 
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
17
<tr>
 
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">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="annotated.html"><font color="#004faf">Annotated</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <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">Q3PtrList Class Reference</h1>
 
21
<p>The Q3PtrList class is a template class that provides a list. <a href="#details">More...</a></p>
 
22
<pre>#include &lt;Q3PtrList&gt;</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>
 
24
<p>Inherits <a href="q3ptrcollection.html">Q3PtrCollection</a>.</p>
 
25
<p>Inherited by <a href="q3strlist.html">Q3StrList</a>.</p>
 
26
<ul>
 
27
<li><a href="q3ptrlist-members.html">List of all members, including inherited members</a></li>
 
28
</ul>
 
29
<a name="public-functions"></a>
 
30
<h3>Public Functions</h3>
 
31
<ul>
 
32
<li><div class="fn"/><b><a href="q3ptrlist.html#Q3PtrList">Q3PtrList</a></b> ()</li>
 
33
<li><div class="fn"/><b><a href="q3ptrlist.html#Q3PtrList-2">Q3PtrList</a></b> ( const Q3PtrList&lt;type&gt; &amp; <i>list</i> )</li>
 
34
<li><div class="fn"/><b><a href="q3ptrlist.html#dtor.Q3PtrList">~Q3PtrList</a></b> ()</li>
 
35
<li><div class="fn"/>void <b><a href="q3ptrlist.html#append">append</a></b> ( const type * <i>item</i> )</li>
 
36
<li><div class="fn"/>type * <b><a href="q3ptrlist.html#at">at</a></b> ( uint <i>index</i> )</li>
 
37
<li><div class="fn"/>int <b><a href="q3ptrlist.html#at-2">at</a></b> () const</li>
 
38
<li><div class="fn"/>virtual void <b><a href="q3ptrlist.html#clear">clear</a></b> ()</li>
 
39
<li><div class="fn"/>uint <b><a href="q3ptrlist.html#contains">contains</a></b> ( const type * <i>item</i> ) const</li>
 
40
<li><div class="fn"/>uint <b><a href="q3ptrlist.html#containsRef">containsRef</a></b> ( const type * <i>item</i> ) const</li>
 
41
<li><div class="fn"/>virtual uint <b><a href="q3ptrlist.html#count">count</a></b> () const</li>
 
42
<li><div class="fn"/>type * <b><a href="q3ptrlist.html#current">current</a></b> () const</li>
 
43
<li><div class="fn"/>Q3LNode * <b><a href="q3ptrlist.html#currentNode">currentNode</a></b> () const</li>
 
44
<li><div class="fn"/>int <b><a href="q3ptrlist.html#find">find</a></b> ( const type * <i>item</i> )</li>
 
45
<li><div class="fn"/>int <b><a href="q3ptrlist.html#findNext">findNext</a></b> ( const type * <i>item</i> )</li>
 
46
<li><div class="fn"/>int <b><a href="q3ptrlist.html#findNextRef">findNextRef</a></b> ( const type * <i>item</i> )</li>
 
47
<li><div class="fn"/>int <b><a href="q3ptrlist.html#findRef">findRef</a></b> ( const type * <i>item</i> )</li>
 
48
<li><div class="fn"/>type * <b><a href="q3ptrlist.html#first">first</a></b> ()</li>
 
49
<li><div class="fn"/>type * <b><a href="q3ptrlist.html#getFirst">getFirst</a></b> () const</li>
 
50
<li><div class="fn"/>type * <b><a href="q3ptrlist.html#getLast">getLast</a></b> () const</li>
 
51
<li><div class="fn"/>void <b><a href="q3ptrlist.html#inSort">inSort</a></b> ( const type * <i>item</i> )</li>
 
52
<li><div class="fn"/>bool <b><a href="q3ptrlist.html#insert">insert</a></b> ( uint <i>index</i>, const type * <i>item</i> )</li>
 
53
<li><div class="fn"/>bool <b><a href="q3ptrlist.html#isEmpty">isEmpty</a></b> () const</li>
 
54
<li><div class="fn"/>type * <b><a href="q3ptrlist.html#last">last</a></b> ()</li>
 
55
<li><div class="fn"/>type * <b><a href="q3ptrlist.html#next">next</a></b> ()</li>
 
56
<li><div class="fn"/>void <b><a href="q3ptrlist.html#prepend">prepend</a></b> ( const type * <i>item</i> )</li>
 
57
<li><div class="fn"/>type * <b><a href="q3ptrlist.html#prev">prev</a></b> ()</li>
 
58
<li><div class="fn"/>bool <b><a href="q3ptrlist.html#remove">remove</a></b> ( uint <i>index</i> )</li>
 
59
<li><div class="fn"/>bool <b><a href="q3ptrlist.html#remove-2">remove</a></b> ()</li>
 
60
<li><div class="fn"/>bool <b><a href="q3ptrlist.html#remove-3">remove</a></b> ( const type * <i>item</i> )</li>
 
61
<li><div class="fn"/>bool <b><a href="q3ptrlist.html#removeFirst">removeFirst</a></b> ()</li>
 
62
<li><div class="fn"/>bool <b><a href="q3ptrlist.html#removeLast">removeLast</a></b> ()</li>
 
63
<li><div class="fn"/>void <b><a href="q3ptrlist.html#removeNode">removeNode</a></b> ( Q3LNode * <i>node</i> )</li>
 
64
<li><div class="fn"/>bool <b><a href="q3ptrlist.html#removeRef">removeRef</a></b> ( const type * <i>item</i> )</li>
 
65
<li><div class="fn"/>bool <b><a href="q3ptrlist.html#replace">replace</a></b> ( uint <i>index</i>, const type * <i>item</i> )</li>
 
66
<li><div class="fn"/>void <b><a href="q3ptrlist.html#sort">sort</a></b> ()</li>
 
67
<li><div class="fn"/>type * <b><a href="q3ptrlist.html#take">take</a></b> ( uint <i>index</i> )</li>
 
68
<li><div class="fn"/>type * <b><a href="q3ptrlist.html#take-2">take</a></b> ()</li>
 
69
<li><div class="fn"/>type * <b><a href="q3ptrlist.html#takeNode">takeNode</a></b> ( Q3LNode * <i>node</i> )</li>
 
70
<li><div class="fn"/>void <b><a href="q3ptrlist.html#toVector">toVector</a></b> ( Q3GVector * <i>vec</i> ) const</li>
 
71
<li><div class="fn"/>bool <b><a href="q3ptrlist.html#operator-not-eq">operator!=</a></b> ( const Q3PtrList&lt;type&gt; &amp; <i>list</i> ) const</li>
 
72
<li><div class="fn"/>Q3PtrList&lt;type&gt; &amp; <b><a href="q3ptrlist.html#operator-eq">operator=</a></b> ( const Q3PtrList&lt;type&gt; &amp; <i>list</i> )</li>
 
73
<li><div class="fn"/>bool <b><a href="q3ptrlist.html#operator-eq-eq">operator==</a></b> ( const Q3PtrList&lt;type&gt; &amp; <i>list</i> ) const</li>
 
74
</ul>
 
75
<ul>
 
76
<li><div class="fn"/>4 public functions inherited from <a href="q3ptrcollection.html#public-functions">Q3PtrCollection</a></li>
 
77
</ul>
 
78
<a name="protected-functions"></a>
 
79
<h3>Protected Functions</h3>
 
80
<ul>
 
81
<li><div class="fn"/>virtual int <b><a href="q3ptrlist.html#compareItems">compareItems</a></b> ( Q3PtrCollection::Item <i>item1</i>, Q3PtrCollection::Item <i>item2</i> )</li>
 
82
<li><div class="fn"/>virtual QDataStream &amp; <b><a href="q3ptrlist.html#read">read</a></b> ( QDataStream &amp; <i>s</i>, Q3PtrCollection::Item &amp; <i>item</i> )</li>
 
83
<li><div class="fn"/>virtual QDataStream &amp; <b><a href="q3ptrlist.html#write">write</a></b> ( QDataStream &amp; <i>s</i>, Q3PtrCollection::Item <i>item</i> ) const</li>
 
84
</ul>
 
85
<ul>
 
86
<li><div class="fn"/>2 protected functions inherited from <a href="q3ptrcollection.html#protected-functions">Q3PtrCollection</a></li>
 
87
</ul>
 
88
<a name="details"></a>
 
89
<hr />
 
90
<h2>Detailed Description</h2>
 
91
<p>The Q3PtrList class is a template class that provides a list.</p>
 
92
<p><a href="q3valuelist.html">Q3ValueList</a> is an STL-compatible alternative to this class.</p>
 
93
<p>Define a template instance Q3PtrList&lt;X&gt; to create a list that operates on pointers to X (X*).</p>
 
94
<p>The list class is indexable and has a <a href="q3ptrlist.html#at">current index</a> and a <a href="q3ptrlist.html#current">current item</a>. The first item corresponds to index position 0. The current index is -1 if the current item is 0.</p>
 
95
<p>Items are inserted with <a href="q3ptrlist.html#prepend">prepend</a>(), <a href="q3ptrlist.html#insert">insert</a>() or <a href="q3ptrlist.html#append">append</a>(). Items are removed with <a href="q3ptrlist.html#remove">remove</a>(), <a href="q3ptrlist.html#removeRef">removeRef</a>(), <a href="q3ptrlist.html#removeFirst">removeFirst</a>() and <a href="q3ptrlist.html#removeLast">removeLast</a>(). You can search for an item using <a href="q3ptrlist.html#find">find</a>(), <a href="q3ptrlist.html#findNext">findNext</a>(), <a href="q3ptrlist.html#findRef">findRef</a>() or <a href="q3ptrlist.html#findNextRef">findNextRef</a>(). The list can be sorted with <a href="q3ptrlist.html#sort">sort</a>(). You can count the number of occurrences of an item with <a href="q3ptrlist.html#contains">contains</a>() or <a href="q3ptrlist.html#containsRef">containsRef</a>(). You can get a pointer to the current item with <a href="q3ptrlist.html#current">current</a>(), to an item at a particular index position in the list with <a href="q3ptrlist.html#at">at</a>() or to the first or last item with <a href="q3ptrlist.html#getFirst">getFirst</a>() and <a href="q3ptrlist.html#getLast">getLast</a>(). You can also iterate over the list with <a href="q3ptrlist.html#first">first</a>(), <a href="q3ptrlist.html#last">last</a>(), <a href="q3ptrlist.html#next">next</a>() and <a href="q3ptrlist.html#prev">prev</a>() (which all update <a href="q3ptrlist.html#current">current</a>()). The list's deletion property is set with <a href="q3ptrcollection.html#setAutoDelete">setAutoDelete</a>().</p>
 
96
<a name="example"></a><p>Example:</p>
 
97
<pre>&nbsp;   class Employee
 
98
    {
 
99
    public:
 
100
        Employee() : sn( 0 ) { }
 
101
        Employee( const QString&amp; forename, const QString&amp; surname, int salary )
 
102
            : fn( forename ), sn( surname ), sal( salary )
 
103
        { }
 
104
 
 
105
        void setSalary( int salary ) { sal = salary; }
 
106
 
 
107
        QString forename() const { return fn; }
 
108
        QString surname() const { return sn; }
 
109
        int salary() const { return sal; }
 
110
 
 
111
    private:
 
112
        QString fn;
 
113
        QString sn;
 
114
        int sal;
 
115
    };
 
116
 
 
117
    Q3PtrList&lt;Employee&gt; list;
 
118
    list.setAutoDelete( TRUE ); // the list owns the objects
 
119
 
 
120
    list.append( new Employee(&quot;John&quot;, &quot;Doe&quot;, 50000) );
 
121
    list.append( new Employee(&quot;Jane&quot;, &quot;Williams&quot;, 80000) );
 
122
    list.append( new Employee(&quot;Tom&quot;, &quot;Jones&quot;, 60000) );
 
123
 
 
124
    Employee *employee;
 
125
    for ( employee = list.first(); employee; employee = list.next() )
 
126
        cout &lt;&lt; employee-&gt;surname().latin1() &lt;&lt; &quot;, &quot; &lt;&lt;
 
127
                employee-&gt;forename().latin1() &lt;&lt; &quot; earns &quot; &lt;&lt;
 
128
                employee-&gt;salary() &lt;&lt; endl;
 
129
    cout &lt;&lt; endl;
 
130
 
 
131
    // very inefficient for big lists
 
132
    for ( uint i = 0; i &lt; list.count(); ++i )
 
133
        if ( list.at(i) )
 
134
            cout &lt;&lt; list.at( i )-&gt;surname().latin1() &lt;&lt; endl;</pre>
 
135
<p>The output is</p>
 
136
<pre>&nbsp;   Doe, John earns 50000
 
137
    Williams, Jane earns 80000
 
138
    Jones, Tom earns 60000
 
139
 
 
140
    Doe
 
141
    Williams
 
142
    Jones</pre>
 
143
<p>Q3PtrList has several member functions for traversing the list, but using a <a href="q3ptrlistiterator.html">Q3PtrListIterator</a> can be more practical. Multiple list iterators may traverse the same list, independently of each other and of the current list item.</p>
 
144
<p>In the example above we make the call setAutoDelete(true). Enabling auto-deletion tells the list to delete items that are removed. The default is to not delete items when they are removed but this would cause a memory leak in the example because there are no other references to the list items.</p>
 
145
<p>When inserting an item into a list only the pointer is copied, not the item itself, i.e. a shallow copy. It is possible to make the list copy all of the item's data (deep copy) when an item is inserted. <a href="q3ptrlist.html#insert">insert</a>(), <a href="q3ptrlist.html#inSort">inSort</a>() and <a href="q3ptrlist.html#append">append</a>() call the virtual function <a href="q3ptrcollection.html#newItem">Q3PtrCollection::newItem</a>() for the item to be inserted. Inherit a list and reimplement <a href="q3ptrcollection.html#newItem">newItem</a>() to have deep copies.</p>
 
146
<p>When removing an item from a list, the virtual function <a href="q3ptrcollection.html#deleteItem">Q3PtrCollection::deleteItem</a>() is called. Q3PtrList's default implementation is to delete the item if auto-deletion is enabled.</p>
 
147
<p>The virtual function <a href="q3ptrlist.html#compareItems">compareItems</a>() can be reimplemented to compare two list items. This function is called from all list functions that need to compare list items, for instance remove(const type*). If you only want to deal with pointers, there are functions that compare pointers instead, for instance removeRef(const type*). These functions are somewhat faster than those that call <a href="q3ptrlist.html#compareItems">compareItems</a>().</p>
 
148
<p>List items are stored as <tt>void*</tt> in an internal <a href="q3lnode.html">Q3LNode</a>, which also holds pointers to the next and previous list items. The functions <a href="q3ptrlist.html#currentNode">currentNode</a>(), <a href="q3ptrlist.html#removeNode">removeNode</a>(), and <a href="q3ptrlist.html#takeNode">takeNode</a>() operate directly on the <a href="q3lnode.html">Q3LNode</a>, but they should be used with care. The data component of the node is available through <a href="q3lnode.html#getData">Q3LNode::getData</a>().</p>
 
149
<p>The <a href="q3strlist.html">Q3StrList</a> class is a list of <tt>char*</tt>. It reimplements <a href="q3ptrcollection.html#newItem">newItem</a>(), <a href="q3ptrlist.html#deleteItem">deleteItem</a>() and <a href="q3ptrlist.html#compareItems">compareItems</a>(). (But see <a href="qstringlist.html">QStringList</a> for a list of Unicode QStrings.)</p>
 
150
<p>See also <a href="q3ptrlistiterator.html">Q3PtrListIterator</a>.</p>
 
151
<hr />
 
152
<h2>Member Function Documentation</h2>
 
153
<h3 class="fn"><a name="Q3PtrList"></a>Q3PtrList::Q3PtrList ()</h3>
 
154
<p>Constructs an empty list.</p>
 
155
<h3 class="fn"><a name="Q3PtrList-2"></a>Q3PtrList::Q3PtrList ( const Q3PtrList&lt;type&gt; &amp; <i>list</i> )</h3>
 
156
<p>Constructs a copy of <i>list</i>.</p>
 
157
<p>Each item in <i>list</i> is <a href="q3ptrlist.html#append">appended</a> to this list. Only the pointers are copied (shallow copy).</p>
 
158
<h3 class="fn"><a name="dtor.Q3PtrList"></a>Q3PtrList::~Q3PtrList ()</h3>
 
159
<p>Removes all items from the list and destroys the list.</p>
 
160
<p>All list iterators that access this list will be reset.</p>
 
161
<p>See also <a href="q3ptrcollection.html#setAutoDelete">setAutoDelete</a>().</p>
 
162
<h3 class="fn"><a name="append"></a>void Q3PtrList::append ( const type * <i>item</i> )</h3>
 
163
<p>Inserts the <i>item</i> at the end of the list.</p>
 
164
<p>The inserted item becomes the current list item. This is equivalent to <tt>insert( count(), item )</tt>.</p>
 
165
<p><i>item</i> must not be 0.</p>
 
166
<p>See also <a href="q3ptrlist.html#insert">insert</a>(), <a href="q3ptrlist.html#current">current</a>(), and <a href="q3ptrlist.html#prepend">prepend</a>().</p>
 
167
<h3 class="fn"><a name="at"></a>type * Q3PtrList::at ( <a href="qtglobal.html#uint-typedef">uint</a> <i>index</i> )</h3>
 
168
<p>Returns a pointer to the item at position <i>index</i> in the list, or 0 if the index is out of range.</p>
 
169
<p>Sets the current list item to this item if <i>index</i> is valid. The valid range is <tt>0..(count() - 1)</tt> inclusive.</p>
 
170
<p>This function is very efficient. It starts scanning from the first item, last item, or current item, whichever is closest to <i>index</i>.</p>
 
171
<p>See also <a href="q3ptrlist.html#current">current</a>().</p>
 
172
<h3 class="fn"><a name="at-2"></a>int Q3PtrList::at () const</h3>
 
173
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
174
<p>Returns the index of the current list item. The returned value is -1 if the current item is 0.</p>
 
175
<p>See also <a href="q3ptrlist.html#current">current</a>().</p>
 
176
<h3 class="fn"><a name="clear"></a>void Q3PtrList::clear ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
177
<p>Removes all items from the list.</p>
 
178
<p>The removed items are deleted if <a href="q3ptrcollection.html#setAutoDelete">auto-deletion</a> is enabled.</p>
 
179
<p>All list iterators that access this list will be reset.</p>
 
180
<p>Reimplemented from <a href="q3ptrcollection.html#clear">Q3PtrCollection</a>.</p>
 
181
<p>See also <a href="q3ptrlist.html#remove">remove</a>(), <a href="q3ptrlist.html#take">take</a>(), and <a href="q3ptrcollection.html#setAutoDelete">setAutoDelete</a>().</p>
 
182
<h3 class="fn"><a name="compareItems"></a>int Q3PtrList::compareItems ( <a href="q3ptrcollection.html#Item-typedef">Q3PtrCollection::Item</a> <i>item1</i>, <a href="q3ptrcollection.html#Item-typedef">Q3PtrCollection::Item</a> <i>item2</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
183
<p>This virtual function compares two list items.</p>
 
184
<p>Returns:</p>
 
185
<ul>
 
186
<li>zero if <i>item1</i> == <i>item2</i></li>
 
187
<li>nonzero if <i>item1</i> != <i>item2</i></li>
 
188
</ul>
 
189
<p>This function returns <i>int</i> rather than <i>bool</i> so that reimplementations can return three values and use it to sort by:</p>
 
190
<ul>
 
191
<li>0 if <i>item1</i> == <i>item2</i></li>
 
192
<li>&gt; 0 (positive integer) if <i>item1</i> &gt; <i>item2</i></li>
 
193
<li>&lt; 0 (negative integer) if <i>item1</i> &lt; <i>item2</i></li>
 
194
</ul>
 
195
<p><a href="q3ptrlist.html#inSort">inSort</a>() requires that compareItems() is implemented as described here.</p>
 
196
<p>This function should not modify the list because some const functions call compareItems().</p>
 
197
<p>The default implementation compares the pointers.</p>
 
198
<h3 class="fn"><a name="contains"></a><a href="qtglobal.html#uint-typedef">uint</a> Q3PtrList::contains ( const type * <i>item</i> ) const</h3>
 
199
<p>Returns the number of occurrences of <i>item</i> in the list.</p>
 
200
<p>The <a href="q3ptrlist.html#compareItems">compareItems</a>() function is called when looking for the <i>item</i> in the list. If <a href="q3ptrlist.html#compareItems">compareItems</a>() is not reimplemented, it is more efficient to call <a href="q3ptrlist.html#containsRef">containsRef</a>().</p>
 
201
<p>This function does not affect the current list item.</p>
 
202
<p>See also <a href="q3ptrlist.html#containsRef">containsRef</a>() and <a href="q3ptrlist.html#compareItems">compareItems</a>().</p>
 
203
<h3 class="fn"><a name="containsRef"></a><a href="qtglobal.html#uint-typedef">uint</a> Q3PtrList::containsRef ( const type * <i>item</i> ) const</h3>
 
204
<p>Returns the number of occurrences of <i>item</i> in the list.</p>
 
205
<p>Calling this function is much faster than <a href="q3ptrlist.html#contains">contains</a>() because <a href="q3ptrlist.html#contains">contains</a>() compares <i>item</i> with each list item using <a href="q3ptrlist.html#compareItems">compareItems</a>(), whereas his function only compares the pointers.</p>
 
206
<p>This function does not affect the current list item.</p>
 
207
<p>See also <a href="q3ptrlist.html#contains">contains</a>().</p>
 
208
<h3 class="fn"><a name="count"></a><a href="qtglobal.html#uint-typedef">uint</a> Q3PtrList::count () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
209
<p>Returns the number of items in the list.</p>
 
210
<p>Reimplemented from <a href="q3ptrcollection.html#count">Q3PtrCollection</a>.</p>
 
211
<p>See also <a href="q3ptrlist.html#isEmpty">isEmpty</a>().</p>
 
212
<h3 class="fn"><a name="current"></a>type * Q3PtrList::current () const</h3>
 
213
<p>Returns a pointer to the current list item. The current item may be 0 (implies that the current index is -1).</p>
 
214
<p>See also <a href="q3ptrlist.html#at">at</a>().</p>
 
215
<h3 class="fn"><a name="currentNode"></a><a href="q3lnode.html">Q3LNode</a> * Q3PtrList::currentNode () const</h3>
 
216
<p>Returns a pointer to the current list node.</p>
 
217
<p>The node can be kept and removed later using <a href="q3ptrlist.html#removeNode">removeNode</a>(). The advantage is that the item can be removed directly without searching the list.</p>
 
218
<p><b>Warning:</b> Do not call this function unless you are an expert.</p>
 
219
<p>See also <a href="q3ptrlist.html#removeNode">removeNode</a>(), <a href="q3ptrlist.html#takeNode">takeNode</a>(), and <a href="q3ptrlist.html#current">current</a>().</p>
 
220
<h3 class="fn"><a name="find"></a>int Q3PtrList::find ( const type * <i>item</i> )</h3>
 
221
<p>Finds the first occurrence of <i>item</i> in the list.</p>
 
222
<p>If the item is found, the list sets the current item to point to the found item and returns the index of this item. If the item is not found, the list sets the current item to 0, the current index to -1, and returns -1.</p>
 
223
<p>The <a href="q3ptrlist.html#compareItems">compareItems</a>() function is called when searching for the item in the list. If <a href="q3ptrlist.html#compareItems">compareItems</a>() is not reimplemented, it is more efficient to call <a href="q3ptrlist.html#findRef">findRef</a>().</p>
 
224
<p>See also <a href="q3ptrlist.html#findNext">findNext</a>(), <a href="q3ptrlist.html#findRef">findRef</a>(), <a href="q3ptrlist.html#compareItems">compareItems</a>(), and <a href="q3ptrlist.html#current">current</a>().</p>
 
225
<h3 class="fn"><a name="findNext"></a>int Q3PtrList::findNext ( const type * <i>item</i> )</h3>
 
226
<p>Finds the next occurrence of <i>item</i> in the list, starting from the current list item.</p>
 
227
<p>If the item is found, the list sets the current item to point to the found item and returns the index of this item. If the item is not found, the list sets the current item to 0, the current index to -1, and returns -1.</p>
 
228
<p>The <a href="q3ptrlist.html#compareItems">compareItems</a>() function is called when searching for the item in the list. If <a href="q3ptrlist.html#compareItems">compareItems</a>() is not reimplemented, it is more efficient to call <a href="q3ptrlist.html#findNextRef">findNextRef</a>().</p>
 
229
<p>See also <a href="q3ptrlist.html#find">find</a>(), <a href="q3ptrlist.html#findNextRef">findNextRef</a>(), <a href="q3ptrlist.html#compareItems">compareItems</a>(), and <a href="q3ptrlist.html#current">current</a>().</p>
 
230
<h3 class="fn"><a name="findNextRef"></a>int Q3PtrList::findNextRef ( const type * <i>item</i> )</h3>
 
231
<p>Finds the next occurrence of <i>item</i> in the list, starting from the current list item.</p>
 
232
<p>If the item is found, the list sets the current item to point to the found item and returns the index of this item. If the item is not found, the list sets the current item to 0, the current index to -1, and returns -1.</p>
 
233
<p>Calling this function is much faster than <a href="q3ptrlist.html#findNext">findNext</a>() because <a href="q3ptrlist.html#findNext">findNext</a>() compares <i>item</i> with each list item using <a href="q3ptrlist.html#compareItems">compareItems</a>(), whereas this function only compares the pointers.</p>
 
234
<p>See also <a href="q3ptrlist.html#findRef">findRef</a>(), <a href="q3ptrlist.html#findNext">findNext</a>(), and <a href="q3ptrlist.html#current">current</a>().</p>
 
235
<h3 class="fn"><a name="findRef"></a>int Q3PtrList::findRef ( const type * <i>item</i> )</h3>
 
236
<p>Finds the first occurrence of <i>item</i> in the list.</p>
 
237
<p>If the item is found, the list sets the current item to point to the found item and returns the index of this item. If the item is not found, the list sets the current item to 0, the current index to -1, and returns -1.</p>
 
238
<p>Calling this function is much faster than <a href="q3ptrlist.html#find">find</a>() because <a href="q3ptrlist.html#find">find</a>() compares <i>item</i> with each list item using <a href="q3ptrlist.html#compareItems">compareItems</a>(), whereas this function only compares the pointers.</p>
 
239
<p>See also <a href="q3ptrlist.html#findNextRef">findNextRef</a>(), <a href="q3ptrlist.html#find">find</a>(), and <a href="q3ptrlist.html#current">current</a>().</p>
 
240
<h3 class="fn"><a name="first"></a>type * Q3PtrList::first ()</h3>
 
241
<p>Returns a pointer to the first item in the list and makes this the current list item; returns 0 if the list is empty.</p>
 
242
<p>See also <a href="q3ptrlist.html#getFirst">getFirst</a>(), <a href="q3ptrlist.html#last">last</a>(), <a href="q3ptrlist.html#next">next</a>(), <a href="q3ptrlist.html#prev">prev</a>(), and <a href="q3ptrlist.html#current">current</a>().</p>
 
243
<h3 class="fn"><a name="getFirst"></a>type * Q3PtrList::getFirst () const</h3>
 
244
<p>Returns a pointer to the first item in the list, or 0 if the list is empty.</p>
 
245
<p>This function does not affect the current list item.</p>
 
246
<p>See also <a href="q3ptrlist.html#first">first</a>() and <a href="q3ptrlist.html#getLast">getLast</a>().</p>
 
247
<h3 class="fn"><a name="getLast"></a>type * Q3PtrList::getLast () const</h3>
 
248
<p>Returns a pointer to the last item in the list, or 0 if the list is empty.</p>
 
249
<p>This function does not affect the current list item.</p>
 
250
<p>See also <a href="q3ptrlist.html#last">last</a>() and <a href="q3ptrlist.html#getFirst">getFirst</a>().</p>
 
251
<h3 class="fn"><a name="inSort"></a>void Q3PtrList::inSort ( const type * <i>item</i> )</h3>
 
252
<p>Inserts the <i>item</i> at its sorted position in the list.</p>
 
253
<p>The sort order depends on the virtual <a href="q3ptrlist.html#compareItems">compareItems</a>() function. All items must be inserted with inSort() to maintain the sorting order.</p>
 
254
<p>The inserted item becomes the current list item.</p>
 
255
<p><i>item</i> must not be 0.</p>
 
256
<p><b>Warning:</b> Using inSort() is slow. An alternative, especially if you have lots of items, is to simply <a href="q3ptrlist.html#append">append</a>() or <a href="q3ptrlist.html#insert">insert</a>() them and then use <a href="q3ptrlist.html#sort">sort</a>(). inSort() takes up to O(n) compares. That means inserting n items in your list will need O(n^2) compares whereas <a href="q3ptrlist.html#sort">sort</a>() only needs O(n*log n) for the same task. So use inSort() only if you already have a presorted list and want to insert just a few additional items.</p>
 
257
<p>See also <a href="q3ptrlist.html#insert">insert</a>(), <a href="q3ptrlist.html#compareItems">compareItems</a>(), <a href="q3ptrlist.html#current">current</a>(), and <a href="q3ptrlist.html#sort">sort</a>().</p>
 
258
<h3 class="fn"><a name="insert"></a>bool Q3PtrList::insert ( <a href="qtglobal.html#uint-typedef">uint</a> <i>index</i>, const type * <i>item</i> )</h3>
 
259
<p>Inserts the <i>item</i> at position <i>index</i> in the list.</p>
 
260
<p>Returns TRUE if successful, i.e. if <i>index</i> is in range; otherwise returns FALSE. The valid range is 0 to <a href="q3ptrlist.html#count">count</a>() (inclusively). The item is appended if <i>index</i> == <a href="q3ptrlist.html#count">count</a>().</p>
 
261
<p>The inserted item becomes the current list item.</p>
 
262
<p><i>item</i> must not be 0.</p>
 
263
<p>See also <a href="q3ptrlist.html#append">append</a>(), <a href="q3ptrlist.html#current">current</a>(), and <a href="q3ptrlist.html#replace">replace</a>().</p>
 
264
<h3 class="fn"><a name="isEmpty"></a>bool Q3PtrList::isEmpty () const</h3>
 
265
<p>Returns TRUE if the list is empty; otherwise returns FALSE.</p>
 
266
<p>See also <a href="q3ptrlist.html#count">count</a>().</p>
 
267
<h3 class="fn"><a name="last"></a>type * Q3PtrList::last ()</h3>
 
268
<p>Returns a pointer to the last item in the list and makes this the current list item; returns 0 if the list is empty.</p>
 
269
<p>See also <a href="q3ptrlist.html#getLast">getLast</a>(), <a href="q3ptrlist.html#first">first</a>(), <a href="q3ptrlist.html#next">next</a>(), <a href="q3ptrlist.html#prev">prev</a>(), and <a href="q3ptrlist.html#current">current</a>().</p>
 
270
<h3 class="fn"><a name="next"></a>type * Q3PtrList::next ()</h3>
 
271
<p>Returns a pointer to the item succeeding the current item. Returns 0 if the current item is 0 or equal to the last item.</p>
 
272
<p>Makes the succeeding item current. If the current item before this function call was the last item, the current item will be set to 0. If the current item was 0, this function does nothing.</p>
 
273
<p>See also <a href="q3ptrlist.html#first">first</a>(), <a href="q3ptrlist.html#last">last</a>(), <a href="q3ptrlist.html#prev">prev</a>(), and <a href="q3ptrlist.html#current">current</a>().</p>
 
274
<h3 class="fn"><a name="prepend"></a>void Q3PtrList::prepend ( const type * <i>item</i> )</h3>
 
275
<p>Inserts the <i>item</i> at the start of the list.</p>
 
276
<p>The inserted item becomes the current list item. This is equivalent to <tt>insert( 0, item )</tt>.</p>
 
277
<p><i>item</i> must not be 0.</p>
 
278
<p>See also <a href="q3ptrlist.html#append">append</a>(), <a href="q3ptrlist.html#insert">insert</a>(), and <a href="q3ptrlist.html#current">current</a>().</p>
 
279
<h3 class="fn"><a name="prev"></a>type * Q3PtrList::prev ()</h3>
 
280
<p>Returns a pointer to the item preceding the current item. Returns 0 if the current item is 0 or equal to the first item.</p>
 
281
<p>Makes the preceding item current. If the current item before this function call was the first item, the current item will be set to 0. If the current item was 0, this function does nothing.</p>
 
282
<p>See also <a href="q3ptrlist.html#first">first</a>(), <a href="q3ptrlist.html#last">last</a>(), <a href="q3ptrlist.html#next">next</a>(), and <a href="q3ptrlist.html#current">current</a>().</p>
 
283
<h3 class="fn"><a name="read"></a><a href="qdatastream.html">QDataStream</a> &amp; Q3PtrList::read ( <a href="qdatastream.html">QDataStream</a> &amp; <i>s</i>, <a href="q3ptrcollection.html#Item-typedef">Q3PtrCollection::Item</a> &amp; <i>item</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
284
<p>Reads a list item from the stream <i>s</i> and returns a reference to the stream.</p>
 
285
<p>The default implementation sets <i>item</i> to 0.</p>
 
286
<p>See also <a href="q3ptrlist.html#write">write</a>().</p>
 
287
<h3 class="fn"><a name="remove"></a>bool Q3PtrList::remove ( <a href="qtglobal.html#uint-typedef">uint</a> <i>index</i> )</h3>
 
288
<p>Removes the item at position <i>index</i> in the list.</p>
 
289
<p>Returns TRUE if successful, i.e. if <i>index</i> is in range; otherwise returns FALSE. The valid range is <tt>0..(count() - 1)</tt> inclusive.</p>
 
290
<p>The removed item is deleted if <a href="q3ptrcollection.html#setAutoDelete">auto-deletion</a> is enabled.</p>
 
291
<p>The item after the removed item becomes the new current list item if the removed item is not the last item in the list. If the last item is removed, the new last item becomes the current item.</p>
 
292
<p>All list iterators that refer to the removed item will be set to point to the new current item.</p>
 
293
<p>See also <a href="q3ptrlist.html#take">take</a>(), <a href="q3ptrlist.html#clear">clear</a>(), <a href="q3ptrcollection.html#setAutoDelete">setAutoDelete</a>(), <a href="q3ptrlist.html#current">current</a>(), and <a href="q3ptrlist.html#removeRef">removeRef</a>().</p>
 
294
<h3 class="fn"><a name="remove-2"></a>bool Q3PtrList::remove ()</h3>
 
295
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
296
<p>Removes the current list item.</p>
 
297
<p>Returns TRUE if successful, i.e. if the current item isn't 0; otherwise returns FALSE.</p>
 
298
<p>The removed item is deleted if <a href="q3ptrcollection.html#setAutoDelete">auto-deletion</a> is enabled.</p>
 
299
<p>The item after the removed item becomes the new current list item if the removed item is not the last item in the list. If the last item is removed, the new last item becomes the current item. The current item is set to 0 if the list becomes empty.</p>
 
300
<p>All list iterators that refer to the removed item will be set to point to the new current item.</p>
 
301
<p>See also <a href="q3ptrlist.html#take">take</a>(), <a href="q3ptrlist.html#clear">clear</a>(), <a href="q3ptrcollection.html#setAutoDelete">setAutoDelete</a>(), <a href="q3ptrlist.html#current">current</a>(), and <a href="q3ptrlist.html#removeRef">removeRef</a>().</p>
 
302
<h3 class="fn"><a name="remove-3"></a>bool Q3PtrList::remove ( const type * <i>item</i> )</h3>
 
303
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
304
<p>Removes the first occurrence of <i>item</i> from the list.</p>
 
305
<p>Returns TRUE if successful, i.e. if <i>item</i> is in the list; otherwise returns FALSE.</p>
 
306
<p>The removed item is deleted if <a href="q3ptrcollection.html#setAutoDelete">auto-deletion</a> is enabled.</p>
 
307
<p>The <a href="q3ptrlist.html#compareItems">compareItems</a>() function is called when searching for the item in the list. If <a href="q3ptrlist.html#compareItems">compareItems</a>() is not reimplemented, it is more efficient to call <a href="q3ptrlist.html#removeRef">removeRef</a>().</p>
 
308
<p>If <i>item</i> is NULL then the current item is removed from the list.</p>
 
309
<p>The item after the removed item becomes the new current list item if the removed item is not the last item in the list. If the last item is removed, the new last item becomes the current item. The current item is set to 0 if the list becomes empty.</p>
 
310
<p>All list iterators that refer to the removed item will be set to point to the new current item.</p>
 
311
<p>See also <a href="q3ptrlist.html#removeRef">removeRef</a>(), <a href="q3ptrlist.html#take">take</a>(), <a href="q3ptrlist.html#clear">clear</a>(), <a href="q3ptrcollection.html#setAutoDelete">setAutoDelete</a>(), <a href="q3ptrlist.html#compareItems">compareItems</a>(), and <a href="q3ptrlist.html#current">current</a>().</p>
 
312
<h3 class="fn"><a name="removeFirst"></a>bool Q3PtrList::removeFirst ()</h3>
 
313
<p>Removes the first item from the list. Returns TRUE if successful, i.e. if the list isn't empty; otherwise returns FALSE.</p>
 
314
<p>The removed item is deleted if <a href="q3ptrcollection.html#setAutoDelete">auto-deletion</a> is enabled.</p>
 
315
<p>The first item in the list becomes the new current list item. The current item is set to 0 if the list becomes empty.</p>
 
316
<p>All list iterators that refer to the removed item will be set to point to the new current item.</p>
 
317
<p>See also <a href="q3ptrlist.html#removeLast">removeLast</a>(), <a href="q3ptrcollection.html#setAutoDelete">setAutoDelete</a>(), <a href="q3ptrlist.html#current">current</a>(), and <a href="q3ptrlist.html#remove">remove</a>().</p>
 
318
<h3 class="fn"><a name="removeLast"></a>bool Q3PtrList::removeLast ()</h3>
 
319
<p>Removes the last item from the list. Returns TRUE if successful, i.e. if the list isn't empty; otherwise returns FALSE.</p>
 
320
<p>The removed item is deleted if <a href="q3ptrcollection.html#setAutoDelete">auto-deletion</a> is enabled.</p>
 
321
<p>The last item in the list becomes the new current list item. The current item is set to 0 if the list becomes empty.</p>
 
322
<p>All list iterators that refer to the removed item will be set to point to the new current item.</p>
 
323
<p>See also <a href="q3ptrlist.html#removeFirst">removeFirst</a>(), <a href="q3ptrcollection.html#setAutoDelete">setAutoDelete</a>(), and <a href="q3ptrlist.html#current">current</a>().</p>
 
324
<h3 class="fn"><a name="removeNode"></a>void Q3PtrList::removeNode ( <a href="q3lnode.html">Q3LNode</a> * <i>node</i> )</h3>
 
325
<p>Removes the <i>node</i> from the list.</p>
 
326
<p>This node must exist in the list, otherwise the program may crash.</p>
 
327
<p>The removed item is deleted if <a href="q3ptrcollection.html#setAutoDelete">auto-deletion</a> is enabled.</p>
 
328
<p>The first item in the list will become the new current list item. The current item is set to 0 if the list becomes empty.</p>
 
329
<p>All list iterators that refer to the removed item will be set to point to the item succeeding this item or to the preceding item if the removed item was the last item.</p>
 
330
<p><b>Warning:</b> Do not call this function unless you are an expert.</p>
 
331
<p>See also <a href="q3ptrlist.html#takeNode">takeNode</a>(), <a href="q3ptrlist.html#currentNode">currentNode</a>(), <a href="q3ptrlist.html#remove">remove</a>(), and <a href="q3ptrlist.html#removeRef">removeRef</a>().</p>
 
332
<h3 class="fn"><a name="removeRef"></a>bool Q3PtrList::removeRef ( const type * <i>item</i> )</h3>
 
333
<p>Removes the first occurrence of <i>item</i> from the list.</p>
 
334
<p>Returns TRUE if successful, i.e. if <i>item</i> is in the list; otherwise returns FALSE.</p>
 
335
<p>The removed item is deleted if <a href="q3ptrcollection.html#setAutoDelete">auto-deletion</a> is enabled.</p>
 
336
<p>Equivalent to:</p>
 
337
<pre>&nbsp;   if ( list.findRef( item ) != -1 )
 
338
        list.remove();</pre>
 
339
<p>The item after the removed item becomes the new current list item if the removed item is not the last item in the list. If the last item is removed, the new last item becomes the current item. The current item is set to 0 if the list becomes empty.</p>
 
340
<p>All list iterators that refer to the removed item will be set to point to the new current item.</p>
 
341
<p>See also <a href="q3ptrlist.html#remove">remove</a>(), <a href="q3ptrlist.html#clear">clear</a>(), <a href="q3ptrcollection.html#setAutoDelete">setAutoDelete</a>(), and <a href="q3ptrlist.html#current">current</a>().</p>
 
342
<h3 class="fn"><a name="replace"></a>bool Q3PtrList::replace ( <a href="qtglobal.html#uint-typedef">uint</a> <i>index</i>, const type * <i>item</i> )</h3>
 
343
<p>Replaces the item at position <i>index</i> with the new <i>item</i>.</p>
 
344
<p>Returns TRUE if successful, i.e. <i>index</i> is in the range 0 to <a href="q3ptrlist.html#count">count</a>()-1.</p>
 
345
<p>See also <a href="q3ptrlist.html#append">append</a>(), <a href="q3ptrlist.html#current">current</a>(), and <a href="q3ptrlist.html#insert">insert</a>().</p>
 
346
<h3 class="fn"><a name="sort"></a>void Q3PtrList::sort ()</h3>
 
347
<p>Sorts the list by the result of the virtual <a href="q3ptrlist.html#compareItems">compareItems</a>() function.</p>
 
348
<p>The heap sort algorithm is used for sorting. It sorts n items with O(n*log n) comparisons. This is the asymptotic optimal solution of the sorting problem.</p>
 
349
<p>If the items in your list support operator&lt;() and operator==(), you might be better off with <a href="q3sortedlist.html">Q3SortedList</a> because it implements the <a href="q3ptrlist.html#compareItems">compareItems</a>() function for you using these two operators.</p>
 
350
<p>See also <a href="q3ptrlist.html#inSort">inSort</a>().</p>
 
351
<h3 class="fn"><a name="take"></a>type * Q3PtrList::take ( <a href="qtglobal.html#uint-typedef">uint</a> <i>index</i> )</h3>
 
352
<p>Takes the item at position <i>index</i> out of the list without deleting it (even if <a href="q3ptrcollection.html#setAutoDelete">auto-deletion</a> is enabled).</p>
 
353
<p>Returns a pointer to the item taken out of the list, or 0 if the index is out of range. The valid range is <tt>0..(count() - 1)</tt> inclusive.</p>
 
354
<p>The item after the removed item becomes the new current list item if the removed item is not the last item in the list. If the last item is removed, the new last item becomes the current item. The current item is set to 0 if the list becomes empty.</p>
 
355
<p>All list iterators that refer to the taken item will be set to point to the new current item.</p>
 
356
<p>See also <a href="q3ptrlist.html#remove">remove</a>(), <a href="q3ptrlist.html#clear">clear</a>(), and <a href="q3ptrlist.html#current">current</a>().</p>
 
357
<h3 class="fn"><a name="take-2"></a>type * Q3PtrList::take ()</h3>
 
358
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
359
<p>Takes the current item out of the list without deleting it (even if <a href="q3ptrcollection.html#setAutoDelete">auto-deletion</a> is enabled).</p>
 
360
<p>Returns a pointer to the item taken out of the list, or 0 if the current item is 0.</p>
 
361
<p>The item after the removed item becomes the new current list item if the removed item is not the last item in the list. If the last item is removed, the new last item becomes the current item. The current item is set to 0 if the list becomes empty.</p>
 
362
<p>All list iterators that refer to the taken item will be set to point to the new current item.</p>
 
363
<p>See also <a href="q3ptrlist.html#remove">remove</a>(), <a href="q3ptrlist.html#clear">clear</a>(), and <a href="q3ptrlist.html#current">current</a>().</p>
 
364
<h3 class="fn"><a name="takeNode"></a>type * Q3PtrList::takeNode ( <a href="q3lnode.html">Q3LNode</a> * <i>node</i> )</h3>
 
365
<p>Takes the <i>node</i> out of the list without deleting its item (even if <a href="q3ptrcollection.html#setAutoDelete">auto-deletion</a> is enabled). Returns a pointer to the item taken out of the list.</p>
 
366
<p>This node must exist in the list, otherwise the program may crash.</p>
 
367
<p>The first item in the list becomes the new current list item.</p>
 
368
<p>All list iterators that refer to the taken item will be set to point to the item succeeding this item or to the preceding item if the taken item was the last item.</p>
 
369
<p><b>Warning:</b> Do not call this function unless you are an expert.</p>
 
370
<p>See also <a href="q3ptrlist.html#removeNode">removeNode</a>() and <a href="q3ptrlist.html#currentNode">currentNode</a>().</p>
 
371
<h3 class="fn"><a name="toVector"></a>void Q3PtrList::toVector ( <a href="q3gvector.html">Q3GVector</a> * <i>vec</i> ) const</h3>
 
372
<p>Stores all list items in the vector <i>vec</i>.</p>
 
373
<p>The vector must be of the same item type, otherwise the result will be undefined.</p>
 
374
<h3 class="fn"><a name="write"></a><a href="qdatastream.html">QDataStream</a> &amp; Q3PtrList::write ( <a href="qdatastream.html">QDataStream</a> &amp; <i>s</i>, <a href="q3ptrcollection.html#Item-typedef">Q3PtrCollection::Item</a> <i>item</i> ) const&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
375
<p>Writes a list item, <i>item</i> to the stream <i>s</i> and returns a reference to the stream.</p>
 
376
<p>The default implementation does nothing.</p>
 
377
<p>See also <a href="q3ptrlist.html#read">read</a>().</p>
 
378
<h3 class="fn"><a name="operator-not-eq"></a>bool Q3PtrList::operator!= ( const Q3PtrList&lt;type&gt; &amp; <i>list</i> ) const</h3>
 
379
<p>Compares this list with <i>list</i>. Returns TRUE if the lists contain different data; otherwise returns FALSE.</p>
 
380
<h3 class="fn"><a name="operator-eq"></a>Q3PtrList&lt;type&gt; &amp; Q3PtrList::operator= ( const Q3PtrList&lt;type&gt; &amp; <i>list</i> )</h3>
 
381
<p>Assigns <i>list</i> to this list and returns a reference to this list.</p>
 
382
<p>This list is first cleared and then each item in <i>list</i> is <a href="q3ptrlist.html#append">appended</a> to this list. Only the pointers are copied (shallow copy) unless <a href="q3ptrcollection.html#newItem">newItem</a>() has been reimplemented.</p>
 
383
<h3 class="fn"><a name="operator-eq-eq"></a>bool Q3PtrList::operator== ( const Q3PtrList&lt;type&gt; &amp; <i>list</i> ) const</h3>
 
384
<p>Compares this list with <i>list</i>. Returns TRUE if the lists contain the same data; otherwise returns FALSE.</p>
 
385
<p /><address><hr /><div align="center">
 
386
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
387
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
388
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
389
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
390
</tr></table></div></address></body>
 
391
</html>