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

« back to all changes in this revision

Viewing changes to doc/html/q3valuevector.html

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
<!DOCTYPE html
3
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
4
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
 
<!-- /fasttmp/mkdist-qt-4.5.2-1245473805/qt-x11-opensource-src-4.5.2/doc/src/q3valuevector.qdoc -->
 
5
<!-- q3valuevector.qdoc -->
6
6
<head>
7
 
  <title>Qt 4.5: Q3ValueVector Class Reference</title>
 
7
  <title>Qt 4.6: Q3ValueVector Class Reference</title>
8
8
  <link href="classic.css" rel="stylesheet" type="text/css" />
9
9
</head>
10
10
<body>
 
11
<a name="//apple_ref/cpp/cl//Q3ValueVector" />
11
12
<table border="0" cellpadding="0" cellspacing="0" width="100%">
12
13
<tr>
13
 
<td align="left" valign="top" width="32"><a href="http://qtsoftware.com/products/qt"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
14
 
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="namespaces.html"><font color="#004faf">All&nbsp;Namespaces</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="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
15
 
<td align="right" valign="top" width="230"></td></tr></table><h1 class="title">Q3ValueVector Class Reference<br /><span class="small-subtitle">[<a href="qt3support.html">Qt3Support</a> module]</span>
 
14
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
 
15
<td width="1">&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="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td><td class="searchBar" align="right" valign="center"><form action="http://www.google.com/cse" id="cse-search-box"><div><input type="hidden" name="cx" value="000136343326384750312:dhbxnqlakyu" /><input type="hidden" name="ie" value="UTF-8" /><input type="text" name="q" size="31" /><input type="submit" name="sa" value="Search" /></div></form></td>
 
16
</tr></table><h1 class="title">Q3ValueVector Class Reference<br /><span class="small-subtitle">[<a href="qt3support.html">Qt3Support</a> module]</span>
16
17
</h1>
17
18
<p>The Q3ValueVector class is a value-based template class that provides a dynamic array. <a href="#details">More...</a></p>
18
19
<pre> #include &lt;Q3ValueVector&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 <a href="porting4.html">Porting to Qt 4</a> for more information.</p>
20
21
<ul>
21
22
<li><a href="q3valuevector-members.html">List of all members, including inherited members</a></li>
22
23
</ul>
 
24
<hr />
23
25
<a name="public-functions"></a>
24
 
<h3>Public Functions</h3>
25
 
<ul>
26
 
<li><div class="fn"></div><b><a href="q3valuevector.html#Q3ValueVector">Q3ValueVector</a></b> ()</li>
27
 
<li><div class="fn"></div><b><a href="q3valuevector.html#Q3ValueVector-2">Q3ValueVector</a></b> ( const Q3ValueVector&lt;T&gt; &amp; <i>v</i> )</li>
28
 
<li><div class="fn"></div><b><a href="q3valuevector.html#Q3ValueVector-3">Q3ValueVector</a></b> ( QVector&lt;T&gt;::size_type <i>n</i>, const T &amp; <i>val</i> = T() )</li>
29
 
<li><div class="fn"></div><b><a href="q3valuevector.html#Q3ValueVector-4">Q3ValueVector</a></b> ( const std::vector&lt;T&gt; &amp; <i>v</i> )</li>
30
 
<li><div class="fn"></div>T &amp; <b><a href="q3valuevector.html#at">at</a></b> ( int <i>i</i>, bool * <i>ok</i> = 0 )</li>
31
 
<li><div class="fn"></div>const T &amp; <b><a href="q3valuevector.html#at-2">at</a></b> ( int <i>i</i>, bool * <i>ok</i> = 0 ) const</li>
32
 
<li><div class="fn"></div>void <b><a href="q3valuevector.html#resize">resize</a></b> ( int <i>n</i>, const T &amp; <i>val</i> = T() )</li>
33
 
<li><div class="fn"></div>Q3ValueVector&lt;T&gt; &amp; <b><a href="q3valuevector.html#operator-eq">operator=</a></b> ( const Q3ValueVector&lt;T&gt; &amp; <i>v</i> )</li>
34
 
<li><div class="fn"></div>Q3ValueVector&lt;T&gt; &amp; <b><a href="q3valuevector.html#operator-eq-2">operator=</a></b> ( const std::vector&lt;T&gt; &amp; <i>v</i> )</li>
35
 
</ul>
36
 
<ul>
37
 
<li><div class="fn"></div>64 public functions inherited from <a href="qvector.html#public-functions">QVector</a></li>
 
26
<h2>Public Functions</h2>
 
27
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
 
28
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="q3valuevector.html#Q3ValueVector">Q3ValueVector</a></b> ()</td></tr>
 
29
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="q3valuevector.html#Q3ValueVector-2">Q3ValueVector</a></b> ( const Q3ValueVector&lt;T&gt; &amp; <i>v</i> )</td></tr>
 
30
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="q3valuevector.html#Q3ValueVector-3">Q3ValueVector</a></b> ( QVector&lt;T&gt;::size_type <i>n</i>, const T &amp; <i>val</i> = T() )</td></tr>
 
31
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="q3valuevector.html#Q3ValueVector-4">Q3ValueVector</a></b> ( const std::vector&lt;T&gt; &amp; <i>v</i> )</td></tr>
 
32
<tr><td class="memItemLeft" align="right" valign="top">T &amp; </td><td class="memItemRight" valign="bottom"><b><a href="q3valuevector.html#at">at</a></b> ( int <i>i</i>, bool * <i>ok</i> = 0 )</td></tr>
 
33
<tr><td class="memItemLeft" align="right" valign="top">const T &amp; </td><td class="memItemRight" valign="bottom"><b><a href="q3valuevector.html#at-2">at</a></b> ( int <i>i</i>, bool * <i>ok</i> = 0 ) const</td></tr>
 
34
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3valuevector.html#resize">resize</a></b> ( int <i>n</i>, const T &amp; <i>val</i> = T() )</td></tr>
 
35
<tr><td class="memItemLeft" align="right" valign="top">Q3ValueVector&lt;T&gt; &amp; </td><td class="memItemRight" valign="bottom"><b><a href="q3valuevector.html#operator-eq">operator=</a></b> ( const Q3ValueVector&lt;T&gt; &amp; <i>v</i> )</td></tr>
 
36
<tr><td class="memItemLeft" align="right" valign="top">Q3ValueVector&lt;T&gt; &amp; </td><td class="memItemRight" valign="bottom"><b><a href="q3valuevector.html#operator-eq-2">operator=</a></b> ( const std::vector&lt;T&gt; &amp; <i>v</i> )</td></tr>
 
37
</table>
 
38
<ul>
 
39
<li><div bar="2" class="fn"></div>64 public functions inherited from <a href="qvector.html#public-functions">QVector</a></li>
38
40
</ul>
39
41
<h3>Additional Inherited Members</h3>
40
42
<ul>
145
147
<p>Q3ValueVector stores its elements in contiguous memory. This means that you can use a Q3ValueVector in any situation that requires an array.</p>
146
148
<hr />
147
149
<h2>Member Function Documentation</h2>
 
150
<a name="//apple_ref/cpp/instm/Q3ValueVector/Q3ValueVector" />
148
151
<h3 class="fn"><a name="Q3ValueVector"></a>Q3ValueVector::Q3ValueVector ()</h3>
149
152
<p>Constructs an empty vector without any elements. To create a vector which reserves an initial amount of space for elements, use <tt>Q3ValueVector(size_type n)</tt>.</p>
150
153
<h3 class="fn"><a name="Q3ValueVector-2"></a>Q3ValueVector::Q3ValueVector ( const Q3ValueVector&lt;T&gt; &amp; <i>v</i> )</h3>
151
154
<p>Constructs a copy of <i>v</i>.</p>
152
 
<p>This operation costs O(1) time because <a href="q3valuevector.html">Q3ValueVector</a> is implicitly shared.</p>
 
155
<p>This operation costs O(1) time because <a href="q3valuevector.html" class="compat">Q3ValueVector</a> is implicitly shared.</p>
153
156
<p>The first modification to the vector does takes O(n) time, because the elements must be copied.</p>
154
157
<h3 class="fn"><a name="Q3ValueVector-3"></a>Q3ValueVector::Q3ValueVector ( <a href="qvector.html">QVector</a>&lt;T&gt;::size_type <i>n</i>, const T &amp; <i>val</i> = T() )</h3>
155
158
<p>Constructs a vector with an initial size of <i>n</i> elements. Each element is initialized with the value of <i>val</i>.</p>
156
159
<h3 class="fn"><a name="Q3ValueVector-4"></a>Q3ValueVector::Q3ValueVector ( const std::vector&lt;T&gt; &amp; <i>v</i> )</h3>
157
160
<p>This operation costs O(n) time because <i>v</i> is copied.</p>
 
161
<a name="//apple_ref/cpp/instm/Q3ValueVector/at" />
158
162
<h3 class="fn"><a name="at"></a>T &amp; Q3ValueVector::at ( int <i>i</i>, bool * <i>ok</i> = 0 )</h3>
159
163
<p>Returns a reference to the element with index <i>i</i>. If <i>ok</i> is non-null, and the index <i>i</i> is out of range, *<i>ok</i> is set to FALSE and the returned reference is undefined. If the index <i>i</i> is within the range of the vector, and <i>ok</i> is non-null, *<i>ok</i> is set to TRUE and the returned reference is well defined.</p>
160
164
<h3 class="fn"><a name="at-2"></a>const T &amp; Q3ValueVector::at ( int <i>i</i>, bool * <i>ok</i> = 0 ) const</h3>
161
165
<p>This is an overloaded function.</p>
162
166
<p>Returns a const reference to the element with index <i>i</i>. If <i>ok</i> is non-null, and the index <i>i</i> is out of range, *<i>ok</i> is set to FALSE and the returned reference is undefined. If the index <i>i</i> is within the range of the vector, and <i>ok</i> is non-null, *<i>ok</i> is set to TRUE and the returned reference is well defined.</p>
 
167
<a name="//apple_ref/cpp/instm/Q3ValueVector/resize" />
163
168
<h3 class="fn"><a name="resize"></a>void Q3ValueVector::resize ( int <i>n</i>, const T &amp; <i>val</i> = T() )</h3>
164
169
<p>Changes the size of the vector to <i>n</i>. If <i>n</i> is greater than the current <a href="qvector.html#size">size</a>(), elements are added to the end and initialized with the value of <i>val</i>. If <i>n</i> is less than <a href="qvector.html#size">size</a>(), elements are removed from the end. If <i>n</i> is equal to <a href="qvector.html#size">size</a>() nothing happens.</p>
 
170
<a name="//apple_ref/cpp/instm/Q3ValueVector/operator=" />
165
171
<h3 class="fn"><a name="operator-eq"></a>Q3ValueVector&lt;T&gt; &amp; Q3ValueVector::operator= ( const Q3ValueVector&lt;T&gt; &amp; <i>v</i> )</h3>
166
172
<p>Assigns <i>v</i> to this vector and returns a reference to this vector.</p>
167
 
<p>All iterators of the current vector become invalidated by this operation. The cost of such an assignment is O(1) since <a href="q3valuevector.html">Q3ValueVector</a> is implicitly shared.</p>
 
173
<p>All iterators of the current vector become invalidated by this operation. The cost of such an assignment is O(1) since <a href="q3valuevector.html" class="compat">Q3ValueVector</a> is implicitly shared.</p>
168
174
<h3 class="fn"><a name="operator-eq-2"></a>Q3ValueVector&lt;T&gt; &amp; Q3ValueVector::operator= ( const std::vector&lt;T&gt; &amp; <i>v</i> )</h3>
169
175
<p>This is an overloaded function.</p>
170
176
<p>Assigns <i>v</i> to this vector and returns a reference to this vector.</p>
171
177
<p>All iterators of the current vector become invalidated by this operation. The cost of this assignment is O(n) since <i>v</i> is copied.</p>
172
178
<p /><address><hr /><div align="center">
173
179
<table width="100%" cellspacing="0" border="0"><tr class="address">
174
 
<td width="30%" align="left">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies)</td>
175
 
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
176
 
<td width="30%" align="right"><div align="right">Qt 4.5.2</div></td>
177
 
</tr></table></div></address></body>
 
180
<td width="40%" align="left">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies)</td>
 
181
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
182
<td width="40%" align="right"><div align="right">Qt 4.6.0</div></td>
 
183
<script type="text/javascript" src="http://www.google.com/jsapi"></script><script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script><script type="text/javascript" src="http://www.google.com/coop/cse/t13n?form=cse-search-box&t13n_langs=en"></script><script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script></tr></table></div></address></body>
178
184
</html>