source: trunk/doc/html/qstrlist.html

Last change on this file was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 5.8 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/doc/qptrlist.doc:1044 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QStrList Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QStrList Class Reference</h1>
33
34<p>The QStrList class provides a doubly-linked list of char*.
35<a href="#details">More...</a>
36<p><tt>#include &lt;<a href="qstrlist-h.html">qstrlist.h</a>&gt;</tt>
37<p>Inherits <a href="qptrlist.html">QPtrList</a>&lt;char&gt;.
38<p>Inherited by <a href="qstrilist.html">QStrIList</a>.
39<p><a href="qstrlist-members.html">List of all member functions.</a>
40<h2>Public Members</h2>
41<ul>
42<li class=fn><a href="#QStrList"><b>QStrList</b></a> ( bool&nbsp;deepCopies = TRUE )</li>
43<li class=fn><a href="#QStrList-2"><b>QStrList</b></a> ( const&nbsp;QStrList&nbsp;&amp;&nbsp;list )</li>
44<li class=fn><a href="#~QStrList"><b>~QStrList</b></a> ()</li>
45<li class=fn>QStrList &amp; <a href="#operator-eq"><b>operator=</b></a> ( const&nbsp;QStrList&nbsp;&amp;&nbsp;list )</li>
46</ul>
47<hr><a name="details"></a><h2>Detailed Description</h2>
48
49
50The QStrList class provides a doubly-linked list of char*.
51<p>
52
53
54<p> If you want a string list of <a href="qstring.html">QString</a>s use <a href="qstringlist.html">QStringList</a>.
55<p> This class is a <a href="qptrlist.html">QPtrList</a>&lt;char&gt; instance (a list of char*).
56<p> QStrList can make deep or shallow copies of the strings that are
57inserted.
58<p> A <a href="shclass.html#deep-copy">deep copy</a> means that memory is allocated for the string and then
59the string data is copied into that memory. A <a href="shclass.html#shallow-copy">shallow copy</a> is just
60a copy of the pointer value and not of the string data itself.
61<p> The disadvantage of shallow copies is that because a pointer can
62be deleted only once, the program must put all strings in a
63central place and know when it is safe to delete them (i.e. when
64the strings are no longer referenced by other parts of the
65program). This can make the program more complex. The advantage of
66shallow copies is that they consume far less memory than deep
67copies. It is also much faster to copy a pointer (typically 4 or 8
68bytes) than to copy string data.
69<p> A QStrList that operates on deep copies will, by default, turn on
70auto-deletion (see <a href="qptrcollection.html#setAutoDelete">setAutoDelete</a>()). Thus, by default QStrList
71will deallocate any string copies it allocates.
72<p> The virtual <a href="qptrlist.html#compareItems">compareItems</a>() function is reimplemented and does a
73case-sensitive string comparison. The <a href="qptrlist.html#inSort">inSort</a>() function will
74insert strings in sorted order. In general it is fastest to insert
75the strings as they come and <a href="qptrlist.html#sort">sort</a>() at the end; inSort() is useful
76when you just have to add a few extra strings to an already sorted
77list.
78<p> The <a href="qstrlistiterator.html">QStrListIterator</a> class is an iterator for QStrList.
79<p>See also <a href="collection.html">Collection Classes</a>, <a href="text.html">Text Related Classes</a>, and <a href="tools.html">Non-GUI Classes</a>.
80
81<hr><h2>Member Function Documentation</h2>
82<h3 class=fn><a name="QStrList"></a>QStrList::QStrList ( bool&nbsp;deepCopies = TRUE )
83</h3>
84
85<p> Constructs an empty list of strings. Will make deep copies of all
86inserted strings if <em>deepCopies</em> is TRUE, or use shallow copies
87if <em>deepCopies</em> is FALSE.
88
89<h3 class=fn><a name="QStrList-2"></a>QStrList::QStrList ( const&nbsp;<a href="qstrlist.html">QStrList</a>&nbsp;&amp;&nbsp;list )
90</h3>
91
92<p> Constructs a copy of <em>list</em>.
93<p> If <em>list</em> has deep copies, this list will also get deep copies.
94Only the pointers are copied (shallow copy) if the other list does
95not use deep copies.
96
97<h3 class=fn><a name="~QStrList"></a>QStrList::~QStrList ()
98</h3>
99
100<p> Destroys the list. All strings are removed.
101
102<h3 class=fn><a href="qstrlist.html">QStrList</a>&nbsp;&amp; <a name="operator-eq"></a>QStrList::operator= ( const&nbsp;<a href="qstrlist.html">QStrList</a>&nbsp;&amp;&nbsp;list )
103</h3>
104
105<p> Assigns <em>list</em> to this list and returns a reference to this list.
106<p> If <em>list</em> has deep copies, this list will also get deep copies.
107Only the pointers are copied (shallow copy) if the other list does
108not use deep copies.
109
110<!-- eof -->
111<hr><p>
112This file is part of the <a href="index.html">Qt toolkit</a>.
113Copyright &copy; 1995-2007
114<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
115<table width=100% cellspacing=0 border=0><tr>
116<td>Copyright &copy; 2007
117<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
118<td align=right><div align=right>Qt 3.3.8</div>
119</table></div></address></body>
120</html>
Note: See TracBrowser for help on using the repository browser.