qstrlist.html
来自「QT 下载资料仅供参考」· HTML 代码 · 共 120 行
HTML
120 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- /home/reggie/tmp/qt-3.0-reggie-5401/qt-x11-commercial-3.0.5/doc/qptrlist.doc:905 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>QStrList 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: #ffffff; color: black; }--></style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr bgcolor="#E5E5E5"><td valign=center> <a href="index.html"><font color="#004faf">Home</font></a> | <a href="classes.html"><font color="#004faf">All Classes</font></a> | <a href="mainclasses.html"><font color="#004faf">Main Classes</font></a> | <a href="annotated.html"><font color="#004faf">Annotated</font></a> | <a href="groups.html"><font color="#004faf">Grouped Classes</font></a> | <a href="functions.html"><font color="#004faf">Functions</font></a></td><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><p>The QStrList class provides a doubly-linked list of char*.<a href="#details">More...</a><p><tt>#include <<a href="qstrlist-h.html">qstrlist.h</a>></tt><p>Inherits <a href="qptrlist.html">QPtrList</a><char>.<p>Inherited by <a href="qstrilist.html">QStrIList</a>.<p><a href="qstrlist-members.html">List of all member functions.</a><h2>Public Members</h2><ul><li><div class=fn><a href="#QStrList"><b>QStrList</b></a> ( bool deepCopies = TRUE )</div></li><li><div class=fn><a href="#QStrList-2"><b>QStrList</b></a> ( const QStrList & list )</div></li><li><div class=fn><a href="#~QStrList"><b>~QStrList</b></a> ()</div></li><li><div class=fn>QStrList & <a href="#operator-eq"><b>operator=</b></a> ( const QStrList & list )</div></li></ul><hr><a name="details"></a><h2>Detailed Description</h2>The QStrList class provides a doubly-linked list of char*.<p> <p> If you want a string list of QStrings use <a href="qstringlist.html">QStringList</a>.<p> This class is a <a href="qptrlist.html">QPtrList</a><char> instance (a list of char*).<p> QStrList can make deep or shallow copies of the strings that are inserted.<p> A <a href="shclass.html#deep-copy">deep copy</a> means that memory is allocated for the string and thenthe string data is copied into this memory. A <a href="shclass.html#shallow-copy">shallow copy</a> is justa copy of the pointer value and not of the string data itself.<p> The disadvantage of shallow copies is that because a pointer can bedeleted only once, the program must put all strings in a centralplace and know when it is safe to delete them (i.e. when thestrings are no longer referenced by other parts of the program).This can make the program more complex. The advantage of shallowcopies is that shallow copies consume far less memory than deepcopies. It is also much faster to copy a pointer (typically 4 or 8bytes) than to copy string data.<p> A QStrList that operates on deep copies will, by default, turn onauto-deletion (see <a href="qptrcollection.html#setAutoDelete">setAutoDelete</a>()). Thus, by default QStrList willdeallocate any string copies it allocates.<p> The virtual <a href="qptrlist.html#compareItems">compareItems</a>() function is reimplemented and does acase-sensitive string comparison. The <a href="qptrlist.html#inSort">inSort</a>() function will insertstrings in a sorted order. In general it is fastest to insert thestrings as they come and <a href="qptrlist.html#sort">sort</a>() at the end; inSort() is usefulwhen you just have to add a few extra strings to an already sortedlist.<p> The <a href="qstrlistiterator.html">QStrListIterator</a> class is an iterator for QStrList.<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>.<hr><h2>Member Function Documentation</h2><h3 class=fn><a name="QStrList"></a>QStrList::QStrList ( bool deepCopies = TRUE )</h3>Constructs an empty list of strings. Will make deep copies of all insertedstrings if <em>deepCopies</em> is TRUE, or use shallow copies if <em>deepCopies</em>is FALSE.<h3 class=fn><a name="QStrList-2"></a>QStrList::QStrList ( const <a href="qstrlist.html">QStrList</a> & list )</h3>Constructs a copy of <em>list</em>.<p> If <em>list</em> has deep copies, this list will also get deep copies.Only the pointers are copied (shallow copy) if the other list does notuse deep copies.<h3 class=fn><a name="~QStrList"></a>QStrList::~QStrList ()</h3>Destroys the list. All strings are removed.<h3 class=fn><a href="qstrlist.html">QStrList</a> & <a name="operator-eq"></a>QStrList::operator= ( const <a href="qstrlist.html">QStrList</a> & list )</h3>Assigns <em>list</em> to this list and returns a reference to this list.<p> If <em>list</em> has deep copies, this list will also get deep copies.Only the pointers are copied (shallow copy) if the other list does notuse deep copies.<!-- eof --><hr><p>This file is part of the <a href="index.html">Qt toolkit</a>.Copyright © 1995-2002<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 © 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td align=right><div align=right>Qt version 3.0.5</div></table></div></address></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?