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

« back to all changes in this revision

Viewing changes to doc/html/q3ptrvector.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/q3ptrvector.qdoc -->
 
6
<head>
 
7
    <title>Qt 4.0: Q3PtrVector 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">Q3PtrVector Class Reference</h1>
 
21
<p>The Q3PtrVector class is a template collection class that provides a vector (array). <a href="#details">More...</a></p>
 
22
<pre>#include &lt;Q3PtrVector&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
<ul>
 
26
<li><a href="q3ptrvector-members.html">List of all members, including inherited members</a></li>
 
27
</ul>
 
28
<a name="public-functions"></a>
 
29
<h3>Public Functions</h3>
 
30
<ul>
 
31
<li><div class="fn"/><b><a href="q3ptrvector.html#Q3PtrVector">Q3PtrVector</a></b> ()</li>
 
32
<li><div class="fn"/><b><a href="q3ptrvector.html#Q3PtrVector-2">Q3PtrVector</a></b> ( uint <i>size</i> )</li>
 
33
<li><div class="fn"/><b><a href="q3ptrvector.html#Q3PtrVector-3">Q3PtrVector</a></b> ( const Q3PtrVector&lt;type&gt; &amp; <i>v</i> )</li>
 
34
<li><div class="fn"/><b><a href="q3ptrvector.html#dtor.Q3PtrVector">~Q3PtrVector</a></b> ()</li>
 
35
<li><div class="fn"/>type * <b><a href="q3ptrvector.html#at">at</a></b> ( uint <i>i</i> ) const</li>
 
36
<li><div class="fn"/>int <b><a href="q3ptrvector.html#bsearch">bsearch</a></b> ( const type * <i>d</i> ) const</li>
 
37
<li><div class="fn"/>virtual void <b><a href="q3ptrvector.html#clear">clear</a></b> ()</li>
 
38
<li><div class="fn"/>uint <b><a href="q3ptrvector.html#contains">contains</a></b> ( const type * <i>d</i> ) const</li>
 
39
<li><div class="fn"/>uint <b><a href="q3ptrvector.html#containsRef">containsRef</a></b> ( const type * <i>d</i> ) const</li>
 
40
<li><div class="fn"/>virtual uint <b><a href="q3ptrvector.html#count">count</a></b> () const</li>
 
41
<li><div class="fn"/>type ** <b><a href="q3ptrvector.html#data">data</a></b> () const</li>
 
42
<li><div class="fn"/>bool <b><a href="q3ptrvector.html#fill">fill</a></b> ( const type * <i>d</i>, int <i>size</i> = -1 )</li>
 
43
<li><div class="fn"/>int <b><a href="q3ptrvector.html#find">find</a></b> ( const type * <i>d</i>, uint <i>i</i> = 0 ) const</li>
 
44
<li><div class="fn"/>int <b><a href="q3ptrvector.html#findRef">findRef</a></b> ( const type * <i>d</i>, uint <i>i</i> = 0 ) const</li>
 
45
<li><div class="fn"/>bool <b><a href="q3ptrvector.html#insert">insert</a></b> ( uint <i>i</i>, const type * <i>d</i> )</li>
 
46
<li><div class="fn"/>bool <b><a href="q3ptrvector.html#isEmpty">isEmpty</a></b> () const</li>
 
47
<li><div class="fn"/>bool <b><a href="q3ptrvector.html#isNull">isNull</a></b> () const</li>
 
48
<li><div class="fn"/>bool <b><a href="q3ptrvector.html#remove">remove</a></b> ( uint <i>i</i> )</li>
 
49
<li><div class="fn"/>bool <b><a href="q3ptrvector.html#resize">resize</a></b> ( uint <i>size</i> )</li>
 
50
<li><div class="fn"/>uint <b><a href="q3ptrvector.html#size">size</a></b> () const</li>
 
51
<li><div class="fn"/>void <b><a href="q3ptrvector.html#sort">sort</a></b> ()</li>
 
52
<li><div class="fn"/>type * <b><a href="q3ptrvector.html#take">take</a></b> ( uint <i>i</i> )</li>
 
53
<li><div class="fn"/>Q3PtrVector&lt;type&gt; &amp; <b><a href="q3ptrvector.html#operator-eq">operator=</a></b> ( const Q3PtrVector&lt;type&gt; &amp; <i>v</i> )</li>
 
54
<li><div class="fn"/>bool <b><a href="q3ptrvector.html#operator-eq-eq">operator==</a></b> ( const Q3PtrVector&lt;type&gt; &amp; <i>v</i> ) const</li>
 
55
<li><div class="fn"/>type * <b><a href="q3ptrvector.html#operator-5b-5d">operator[]</a></b> ( int <i>i</i> ) const</li>
 
56
</ul>
 
57
<ul>
 
58
<li><div class="fn"/>4 public functions inherited from <a href="q3ptrcollection.html#public-functions">Q3PtrCollection</a></li>
 
59
</ul>
 
60
<a name="protected-functions"></a>
 
61
<h3>Protected Functions</h3>
 
62
<ul>
 
63
<li><div class="fn"/>virtual int <b><a href="q3ptrvector.html#compareItems">compareItems</a></b> ( Q3PtrCollection::Item <i>d1</i>, Q3PtrCollection::Item <i>d2</i> )</li>
 
64
<li><div class="fn"/>virtual QDataStream &amp; <b><a href="q3ptrvector.html#read">read</a></b> ( QDataStream &amp; <i>s</i>, Q3PtrCollection::Item &amp; <i>item</i> )</li>
 
65
<li><div class="fn"/>virtual QDataStream &amp; <b><a href="q3ptrvector.html#write">write</a></b> ( QDataStream &amp; <i>s</i>, Q3PtrCollection::Item <i>item</i> ) const</li>
 
66
</ul>
 
67
<ul>
 
68
<li><div class="fn"/>2 protected functions inherited from <a href="q3ptrcollection.html#protected-functions">Q3PtrCollection</a></li>
 
69
</ul>
 
70
<a name="details"></a>
 
71
<hr />
 
72
<h2>Detailed Description</h2>
 
73
<p>The Q3PtrVector class is a template collection class that provides a vector (array).</p>
 
74
<p><a href="q3valuevector.html">Q3ValueVector</a> is an STL-compatible alternative to this class.</p>
 
75
<p>Q3PtrVector is implemented as a template class. Defines a template instance Q3PtrVector&lt;X&gt; to create a vector that contains pointers to X (X*).</p>
 
76
<p>A vector is the same as an array. The main difference between Q3PtrVector and <a href="q3memarray.html">Q3MemArray</a> is that Q3PtrVector stores pointers to the elements, whereas <a href="q3memarray.html">Q3MemArray</a> stores the elements themselves (i.e. <a href="q3memarray.html">Q3MemArray</a> is value-based and Q3PtrVector is pointer-based).</p>
 
77
<p>Items are added to the vector using <a href="q3ptrvector.html#insert">insert</a>() or <a href="q3ptrvector.html#fill">fill</a>(). Items are removed with <a href="q3ptrvector.html#remove">remove</a>(). You can get a pointer to an item at a particular index position using <a href="q3ptrvector.html#at">at</a>().</p>
 
78
<p>Unless otherwise stated, all functions that remove items from the vector will also delete the element pointed to if <a href="q3ptrcollection.html#setAutoDelete">auto-deletion</a> is enabled. By default, auto-deletion is disabled; see <a href="q3ptrcollection.html#setAutoDelete">setAutoDelete</a>(). This behaviour can be changed in a subclass by reimplementing the virtual function <a href="q3ptrvector.html#deleteItem">deleteItem</a>().</p>
 
79
<p>Functions that compare items (<a href="q3ptrvector.html#find">find</a>() and <a href="q3ptrvector.html#sort">sort</a>() for example) will do so using the virtual function <a href="q3ptrvector.html#compareItems">compareItems</a>(). The default implementation of this function only compares the pointer values. Reimplement <a href="q3ptrvector.html#compareItems">compareItems</a>() in a subclass to get searching and sorting based on the item contents. You can perform a linear search for a pointer in the vector using <a href="q3ptrvector.html#findRef">findRef</a>(), or a binary search (of a sorted vector) using <a href="q3ptrvector.html#bsearch">bsearch</a>(). You can count the number of times an item appears in the vector with <a href="q3ptrvector.html#contains">contains</a>() or <a href="q3ptrvector.html#containsRef">containsRef</a>().</p>
 
80
<p>See also <a href="q3memarray.html">Q3MemArray</a>.</p>
 
81
<hr />
 
82
<h2>Member Function Documentation</h2>
 
83
<h3 class="fn"><a name="Q3PtrVector"></a>Q3PtrVector::Q3PtrVector ()</h3>
 
84
<p>Constructs a null vector.</p>
 
85
<p>See also <a href="q3ptrvector.html#isNull">isNull</a>().</p>
 
86
<h3 class="fn"><a name="Q3PtrVector-2"></a>Q3PtrVector::Q3PtrVector ( <a href="qtglobal.html#uint-typedef">uint</a> <i>size</i> )</h3>
 
87
<p>Constructs an vector with room for <i>size</i> items. Makes a null vector if <i>size</i> == 0.</p>
 
88
<p>All <i>size</i> positions in the vector are initialized to 0.</p>
 
89
<p>See also <a href="q3ptrvector.html#size">size</a>(), <a href="q3ptrvector.html#resize">resize</a>(), and <a href="q3ptrvector.html#isNull">isNull</a>().</p>
 
90
<h3 class="fn"><a name="Q3PtrVector-3"></a>Q3PtrVector::Q3PtrVector ( const Q3PtrVector&lt;type&gt; &amp; <i>v</i> )</h3>
 
91
<p>Constructs a copy of <i>v</i>. Only the pointers are copied (i.e. shallow copy).</p>
 
92
<h3 class="fn"><a name="dtor.Q3PtrVector"></a>Q3PtrVector::~Q3PtrVector ()</h3>
 
93
<p>Removes all items from the vector, and destroys the vector itself.</p>
 
94
<p>See also <a href="q3ptrvector.html#clear">clear</a>().</p>
 
95
<h3 class="fn"><a name="at"></a>type * Q3PtrVector::at ( <a href="qtglobal.html#uint-typedef">uint</a> <i>i</i> ) const</h3>
 
96
<p>Returns the item at position <i>i</i>, or 0 if there is no item at that position. <i>i</i> must be less than <a href="q3ptrvector.html#size">size</a>().</p>
 
97
<h3 class="fn"><a name="bsearch"></a>int Q3PtrVector::bsearch ( const type * <i>d</i> ) const</h3>
 
98
<p>In a sorted array, finds the first occurrence of <i>d</i> using a binary search. For a sorted array, this is generally much faster than <a href="q3ptrvector.html#find">find</a>(), which performs a linear search.</p>
 
99
<p>Returns the position of <i>d</i>, or -1 if <i>d</i> could not be found. <i>d</i> must not be 0.</p>
 
100
<p>Compares items using the virtual function <a href="q3ptrvector.html#compareItems">compareItems</a>().</p>
 
101
<p>See also <a href="q3ptrvector.html#sort">sort</a>() and <a href="q3ptrvector.html#find">find</a>().</p>
 
102
<h3 class="fn"><a name="clear"></a>void Q3PtrVector::clear ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
103
<p>Removes all items from the vector, and destroys the vector itself.</p>
 
104
<p>The vector becomes a null vector.</p>
 
105
<p>Reimplemented from <a href="q3ptrcollection.html#clear">Q3PtrCollection</a>.</p>
 
106
<p>See also <a href="q3ptrvector.html#isNull">isNull</a>().</p>
 
107
<h3 class="fn"><a name="compareItems"></a>int Q3PtrVector::compareItems ( <a href="q3ptrcollection.html#Item-typedef">Q3PtrCollection::Item</a> <i>d1</i>, <a href="q3ptrcollection.html#Item-typedef">Q3PtrCollection::Item</a> <i>d2</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
108
<p>This virtual function compares two list items.</p>
 
109
<p>Returns:</p>
 
110
<ul>
 
111
<li>zero if <i>d1</i> == <i>d2</i></li>
 
112
<li>nonzero if <i>d1</i> != <i>d2</i></li>
 
113
</ul>
 
114
<p>This function returns <i>int</i> rather than <i>bool</i> so that reimplementations can return one of three values and use it to sort by:</p>
 
115
<ul>
 
116
<li>0 if <i>d1</i> == <i>d2</i></li>
 
117
<li>&gt; 0 (positive integer) if <i>d1</i> &gt; <i>d2</i></li>
 
118
<li>&lt; 0 (negative integer) if <i>d1</i> &lt; <i>d2</i></li>
 
119
</ul>
 
120
<p>The <a href="q3ptrvector.html#sort">sort</a>() and <a href="q3ptrvector.html#bsearch">bsearch</a>() functions require compareItems() to be implemented as described here.</p>
 
121
<p>This function should not modify the vector because some const functions call compareItems().</p>
 
122
<h3 class="fn"><a name="contains"></a><a href="qtglobal.html#uint-typedef">uint</a> Q3PtrVector::contains ( const type * <i>d</i> ) const</h3>
 
123
<p>Returns the number of occurrences of item <i>d</i> in the vector.</p>
 
124
<p>Compares items using the virtual function <a href="q3ptrvector.html#compareItems">compareItems</a>().</p>
 
125
<p>See also <a href="q3ptrvector.html#containsRef">containsRef</a>().</p>
 
126
<h3 class="fn"><a name="containsRef"></a><a href="qtglobal.html#uint-typedef">uint</a> Q3PtrVector::containsRef ( const type * <i>d</i> ) const</h3>
 
127
<p>Returns the number of occurrences of the item pointer <i>d</i> in the vector.</p>
 
128
<p>This function does <i>not</i> use <a href="q3ptrvector.html#compareItems">compareItems</a>() to compare items.</p>
 
129
<p>See also <a href="q3ptrvector.html#findRef">findRef</a>().</p>
 
130
<h3 class="fn"><a name="count"></a><a href="qtglobal.html#uint-typedef">uint</a> Q3PtrVector::count () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
131
<p>Returns the number of items in the vector. The vector is empty if count() == 0.</p>
 
132
<p>Reimplemented from <a href="q3ptrcollection.html#count">Q3PtrCollection</a>.</p>
 
133
<p>See also <a href="q3ptrvector.html#isEmpty">isEmpty</a>(), <a href="q3ptrvector.html#size">size</a>(), and <a href="q3ptrvector.html#isNull">isNull</a>().</p>
 
134
<h3 class="fn"><a name="data"></a>type ** Q3PtrVector::data () const</h3>
 
135
<p>Returns a pointer to the actual vector data, which is an array of type*.</p>
 
136
<p>The vector is a null vector if data() == 0 (null pointer).</p>
 
137
<p>See also <a href="q3ptrvector.html#isNull">isNull</a>().</p>
 
138
<h3 class="fn"><a name="fill"></a>bool Q3PtrVector::fill ( const type * <i>d</i>, int <i>size</i> = -1 )</h3>
 
139
<p>Inserts item <i>d</i> in all positions in the vector. Any existing items are removed. If <i>d</i> is 0, the vector becomes empty.</p>
 
140
<p>If <i>size</i> &gt;= 0, the vector is first resized to <i>size</i>. By default, <i>size</i> is -1.</p>
 
141
<p>Returns TRUE if successful, i.e. <i>size</i> is the same as the current size, or <i>size</i> is larger and the memory has successfully been allocated; otherwise returns FALSE.</p>
 
142
<p>See also <a href="q3ptrvector.html#resize">resize</a>(), <a href="q3ptrvector.html#insert">insert</a>(), and <a href="q3ptrvector.html#isEmpty">isEmpty</a>().</p>
 
143
<h3 class="fn"><a name="find"></a>int Q3PtrVector::find ( const type * <i>d</i>, <a href="qtglobal.html#uint-typedef">uint</a> <i>i</i> = 0 ) const</h3>
 
144
<p>Finds the first occurrence of item <i>d</i> in the vector using a linear search. The search starts at position <i>i</i>, which must be less than <a href="q3ptrvector.html#size">size</a>(). <i>i</i> is by default 0; i.e. the search starts at the start of the vector.</p>
 
145
<p>Returns the position of <i>d</i>, or -1 if <i>d</i> could not be found.</p>
 
146
<p>Compares items using the virtual function <a href="q3ptrvector.html#compareItems">compareItems</a>().</p>
 
147
<p>Use the much faster <a href="q3ptrvector.html#bsearch">bsearch</a>() to search a sorted vector.</p>
 
148
<p>See also <a href="q3ptrvector.html#findRef">findRef</a>() and <a href="q3ptrvector.html#bsearch">bsearch</a>().</p>
 
149
<h3 class="fn"><a name="findRef"></a>int Q3PtrVector::findRef ( const type * <i>d</i>, <a href="qtglobal.html#uint-typedef">uint</a> <i>i</i> = 0 ) const</h3>
 
150
<p>Finds the first occurrence of the item pointer <i>d</i> in the vector using a linear search. The search starts at position <i>i</i>, which must be less than <a href="q3ptrvector.html#size">size</a>(). <i>i</i> is by default 0; i.e. the search starts at the start of the vector.</p>
 
151
<p>Returns the position of <i>d</i>, or -1 if <i>d</i> could not be found.</p>
 
152
<p>This function does <i>not</i> use <a href="q3ptrvector.html#compareItems">compareItems</a>() to compare items.</p>
 
153
<p>Use the much faster <a href="q3ptrvector.html#bsearch">bsearch</a>() to search a sorted vector.</p>
 
154
<p>See also <a href="q3ptrvector.html#find">find</a>() and <a href="q3ptrvector.html#bsearch">bsearch</a>().</p>
 
155
<h3 class="fn"><a name="insert"></a>bool Q3PtrVector::insert ( <a href="qtglobal.html#uint-typedef">uint</a> <i>i</i>, const type * <i>d</i> )</h3>
 
156
<p>Sets position <i>i</i> in the vector to contain the item <i>d</i>. <i>i</i> must be less than <a href="q3ptrvector.html#size">size</a>(). Any previous element in position <i>i</i> is removed.</p>
 
157
<p>See also <a href="q3ptrvector.html#at">at</a>().</p>
 
158
<h3 class="fn"><a name="isEmpty"></a>bool Q3PtrVector::isEmpty () const</h3>
 
159
<p>Returns TRUE if the vector is empty; otherwise returns FALSE.</p>
 
160
<p>See also <a href="q3ptrvector.html#count">count</a>().</p>
 
161
<h3 class="fn"><a name="isNull"></a>bool Q3PtrVector::isNull () const</h3>
 
162
<p>Returns TRUE if the vector is null; otherwise returns FALSE.</p>
 
163
<p>A null vector has <a href="q3ptrvector.html#size">size</a>() == 0 and <a href="q3ptrvector.html#data">data</a>() == 0.</p>
 
164
<p>See also <a href="q3ptrvector.html#size">size</a>().</p>
 
165
<h3 class="fn"><a name="read"></a><a href="qdatastream.html">QDataStream</a> &amp; Q3PtrVector::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>
 
166
<p>Reads a vector item, <i>item</i>, from the stream <i>s</i> and returns a reference to the stream.</p>
 
167
<p>The default implementation sets <i>item</i> to 0.</p>
 
168
<p>See also <a href="q3ptrvector.html#write">write</a>().</p>
 
169
<h3 class="fn"><a name="remove"></a>bool Q3PtrVector::remove ( <a href="qtglobal.html#uint-typedef">uint</a> <i>i</i> )</h3>
 
170
<p>Removes the item at position <i>i</i> in the vector, if there is one. <i>i</i> must be less than <a href="q3ptrvector.html#size">size</a>().</p>
 
171
<p>Returns TRUE if <i>i</i> is within range; otherwise returns FALSE.</p>
 
172
<p>See also <a href="q3ptrvector.html#take">take</a>() and <a href="q3ptrvector.html#at">at</a>().</p>
 
173
<h3 class="fn"><a name="resize"></a>bool Q3PtrVector::resize ( <a href="qtglobal.html#uint-typedef">uint</a> <i>size</i> )</h3>
 
174
<p>Resizes (expands or shrinks) the vector to <i>size</i> elements. The vector becomes a null vector if <i>size</i> == 0.</p>
 
175
<p>Any items at position <i>size</i> or beyond in the vector are removed. New positions are initialized to 0.</p>
 
176
<p>Returns TRUE if successful, i.e. if the memory was successfully allocated; otherwise returns FALSE.</p>
 
177
<p>See also <a href="q3ptrvector.html#size">size</a>() and <a href="q3ptrvector.html#isNull">isNull</a>().</p>
 
178
<h3 class="fn"><a name="size"></a><a href="qtglobal.html#uint-typedef">uint</a> Q3PtrVector::size () const</h3>
 
179
<p>Returns the size of the vector, i.e. the number of vector positions. This is also the maximum number of items the vector can hold.</p>
 
180
<p>The vector is a null vector if size() == 0.</p>
 
181
<p>See also <a href="q3ptrvector.html#isNull">isNull</a>(), <a href="q3ptrvector.html#resize">resize</a>(), and <a href="q3ptrvector.html#count">count</a>().</p>
 
182
<h3 class="fn"><a name="sort"></a>void Q3PtrVector::sort ()</h3>
 
183
<p>Sorts the items in ascending order. Any empty positions will be put last.</p>
 
184
<p>Compares items using the virtual function <a href="q3ptrvector.html#compareItems">compareItems</a>().</p>
 
185
<p>See also <a href="q3ptrvector.html#bsearch">bsearch</a>().</p>
 
186
<h3 class="fn"><a name="take"></a>type * Q3PtrVector::take ( <a href="qtglobal.html#uint-typedef">uint</a> <i>i</i> )</h3>
 
187
<p>Returns the item at position <i>i</i> in the vector, and removes that item from the vector. <i>i</i> must be less than <a href="q3ptrvector.html#size">size</a>(). If there is no item at position <i>i</i>, 0 is returned.</p>
 
188
<p>Unlike <a href="q3ptrvector.html#remove">remove</a>(), this function does <i>not</i> call <a href="q3ptrvector.html#deleteItem">deleteItem</a>() for the removed item.</p>
 
189
<p>See also <a href="q3ptrvector.html#remove">remove</a>() and <a href="q3ptrvector.html#at">at</a>().</p>
 
190
<h3 class="fn"><a name="write"></a><a href="qdatastream.html">QDataStream</a> &amp; Q3PtrVector::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>
 
191
<p>Writes a vector item, <i>item</i>, to the stream <i>s</i> and returns a reference to the stream.</p>
 
192
<p>The default implementation does nothing.</p>
 
193
<p>See also <a href="q3ptrvector.html#read">read</a>().</p>
 
194
<h3 class="fn"><a name="operator-eq"></a>Q3PtrVector&lt;type&gt; &amp; Q3PtrVector::operator= ( const Q3PtrVector&lt;type&gt; &amp; <i>v</i> )</h3>
 
195
<p>Assigns <i>v</i> to this vector and returns a reference to this vector.</p>
 
196
<p>This vector is first cleared and then all the items from <i>v</i> are copied into the vector. Only the pointers are copied (i.e. shallow copy).</p>
 
197
<p>See also <a href="q3ptrvector.html#clear">clear</a>().</p>
 
198
<h3 class="fn"><a name="operator-eq-eq"></a>bool Q3PtrVector::operator== ( const Q3PtrVector&lt;type&gt; &amp; <i>v</i> ) const</h3>
 
199
<p>Returns TRUE if this vector and <i>v</i> are equal; otherwise returns FALSE.</p>
 
200
<h3 class="fn"><a name="operator-5b-5d"></a>type * Q3PtrVector::operator[] ( int <i>i</i> ) const</h3>
 
201
<p>Returns the item at position <i>i</i>, or 0 if there is no item at that position. <i>i</i> must be less than <a href="q3ptrvector.html#size">size</a>().</p>
 
202
<p>Equivalent to at( <i>i</i> ).</p>
 
203
<p>See also <a href="q3ptrvector.html#at">at</a>().</p>
 
204
<p /><address><hr /><div align="center">
 
205
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
206
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
207
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
208
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
209
</tr></table></div></address></body>
 
210
</html>