QStrList(3qt)
π QStrList β the qstrlist.3qt manual, but make it make sense π
okay bestie, sit down, we're learning about QStrList today and honestly? it's giving "old-school Qt but still kinda iconic". no cap. π
β¨ NAME β¨
QStrList β a doubly-linked list of char*. that's it. that's the whole vibe. π¦
πΈ SYNOPSIS πΈ
#include <qstrlist.h>
Inherits QPtrList<char>.
Inherited by QStrIList.
π Public Members
QStrList ( bool deepCopies = TRUE )
QStrList ( const QStrList & list )
~QStrList ()
QStrList & operator= ( const QStrList & list )
π DESCRIPTION π
so the QStrList class provides a doubly-linked list of char*. literally that's its whole job and it does it well. π«Ά
if you actually want a string list made of QStrings, use QStringList instead. different queen, different crown. π
this class is a QPtrList<char> instance β aka a list of char*. periodt.
here's the tea: QStrList can make deep or shallow copies of the strings you insert. π
- A deep copy means memory is allocated for the string and then the string data gets copied into that memory.
- A shallow copy is just a copy of the pointer value, not of the string data itself.
now the downside of shallow copies, and listen carefully because this one bites: since a pointer can only be deleted once, your program has to put all the strings in a central place and know when it's safe to delete them (meaning: when the strings aren't referenced by other parts of the program anymore). that lowkey makes your program more complex. π
but the upside? shallow copies consume far less memory than deep copies. also it's much faster to copy a pointer (typically 4 or 8 bytes) than to copy actual string data. slay, efficiency. β‘
a QStrList that operates on deep copies will, by default, turn on auto-deletion (see setAutoDelete()). so by default, QStrList deallocates any string copies it allocates. it cleans up after itself, we love a self-sufficient icon. π§
the virtual compareItems() function is reimplemented and does a case-sensitive string comparison. and inSort() will insert strings in sorted order. in general, it's fastest to insert strings as they come and sort() at the end β inSort() is useful when you just have to add a few extra strings to an already sorted list. iykyk. π
also! the QStrListIterator class is an iterator for QStrList. cute.
See also: Collection Classes, Text Related Classes, and Non-GUI Classes.
π MEMBER FUNCTION DOCUMENTATION π
QStrList::QStrList ( bool deepCopies = TRUE )
Constructs an empty list of strings. it'll make deep copies of all inserted strings if deepCopies is TRUE, or use shallow copies if deepCopies is FALSE. your call, bestie. π
QStrList::QStrList ( const QStrList & list )
Constructs a copy of list. π«
if list has deep copies, this list will also get deep copies. only the pointers are copied (shallow copy) if the other list does not use deep copies. match her energy, basically. π
QStrList::~QStrList ()
Destroys the list. all strings are removed. she's gone, she's at peace, we thank her for her service. πβ¨
QStrList & QStrList::operator= ( const QStrList & list )
Assigns list to this list and returns a reference to this list. π₯
if list has deep copies, this list will also get deep copies. only the pointers are copied (shallow copy) if the other list does not use deep copies. yes this is the same rule as the copy constructor, no we're not being repetitive, we're being thorough. π
π SEE ALSO π
π COPYRIGHT π
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.
β AUTHOR β
Generated automatically from the source code. (no human wrote this one, she's a machine-made diva. π€π)
π BUGS π
if you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. good bug reports help us help you. thank you!! π«Ά
the definitive Qt documentation is provided in HTML format; it's located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. this man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. π«
if you find errors in this manual page, please report them to qt-bugs@trolltech.com. please include the name of the manual page (qstrlist.3qt) and the Qt version (3.3.8). ty ty ty. π
and that's the whole page, bestie! π written by Trolltech AS on 2 February 2007, running Qt version 3.3.8 β shoutout to the 2007 girlies, this one's for you. ππΈβ¨
π¦ where this page comes from
- fedora 43: qt3-devel-docs 3.3.8b-102.fc43 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- fedora 44: qt3-devel-docs 3.3.8b-103.fc44 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms