⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qstringlist.3qt

📁 Qt/Embedded是一个多平台的C++图形用户界面应用程序框架
💻 3QT
字号:
.TH QStringList 3qt "10 November 2000" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2000 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQStringList \- A list of strings.SH SYNOPSIS.br.PP\fC#include <qstringlist.h>\fR.PPInherits QValueList..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQStringList\fR () ".br.ti -1c.BI "\fBQStringList\fR ( const QStringList & l ) ".br.ti -1c.BI "\fBQStringList\fR ( const QValueList<QString> & l ) ".br.ti -1c.BI "\fBQStringList\fR ( const QString & i ) ".br.ti -1c.BI "\fBQStringList\fR ( const char * i ) ".br.ti -1c.BI "void \fBsort\fR () ".br.ti -1c.BI "QString \fBjoin\fR ( const QString & sep ) const".br.ti -1c.BI "QStringList \fBgrep\fR ( const QString & " "str" ", bool " "cs" " = TRUE ) const".br.ti -1c.BI "QStringList \fBgrep\fR ( const QRegExp & expr ) const".br.in -1c.SS "Static Public Members".in +1c.ti -1c.BI "QStringList \fBfromStrList\fR ( const QStrList & ) ".br.ti -1c.BI "QStringList \fBsplit\fR ( const QString & " "sep" ", const QString & " "str" ", bool " "allowEmptyEntries" " = FALSE ) ".br.ti -1c.BI "QStringList \fBsplit\fR ( const QChar & " "sep" ", const QString & " "str" ", bool " "allowEmptyEntries" " = FALSE ) ".br.ti -1c.BI "QStringList \fBsplit\fR ( const QRegExp & " "sep" ", const QString & " "str" ", bool " "allowEmptyEntries" " = FALSE ) ".br.in -1c.SH DESCRIPTIONA list of strings..PPQStringList is basically a QValueList of QString objects. As opposed to QStrList, that stores pointers to characters, QStringList deals with real QString objects. It is the class of choice whenever you work with unicode strings..PPLike QString itself, QStringList objects are implicit shared. Passing them around as value-parameters is both fast and safe..PPExample:.PP.nf.br        QStringList list;.br.br        // three different ways of appending values:.br        list.append( "Torben");.br        list += "Warwick";.br        list << "Matthias" << "Arnt" << "Paul";.br.br        // sort the list, Arnt's now first.br        list.sort();.br.br        // print it out.br        for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {.br            printf( "%s \\n", (*it).latin1() );.br        }.fi.PPConvenience methods such as sort(), split(), join() and grep() make working with QStringList easy..SH MEMBER FUNCTION DOCUMENTATION.SH "QStringList::QStringList ()"Creates an empty list..SH "QStringList::QStringList ( const QString & i )"Constructs a string list consisting of the single string \fIi.\fR To make longer lists easily, use:.PP.nf.br    QString s1,s2,s3;.br    ....br    QStringList mylist = QStringList() << s1 << s2 << s3;.fi.SH "QStringList::QStringList ( const QValueList<QString> & l )"Constructs a new string list that is a copy of \fIl.\fR.SH "QStringList::QStringList ( const QStringList & l )"Creates a copy of the list. This function is very fast since QStringList is implicit shared. However, for the programmer this is the same as a deep copy. If this list or the original one or some other list referencing the same shared data is modified, then the modifying list makes a copy first..SH "QStringList::QStringList ( const char * i )"Constructs a string list consisting of the single latin-1 string \fIi.\fR.SH "QStringList QStringList::fromStrList ( const QStrList & ascii ) \fC[static]\fR"Converts from a QStrList (ASCII) to a QStringList (Unicode)..SH "QStringList QStringList::grep ( const QRegExp & expr ) const"Returns a list of all strings containing a substring that matches the regular expression \fIexpr.\fR.SH "QStringList QStringList::grep ( const QString & str, bool cs = TRUE ) const"Returns a list of all strings containing the substring \fIstr.\fR.PPIf \fIcs\fR is TRUE, the grep is done case sensitively, else not..SH "QString QStringList::join ( const QString & sep ) const"Joins the stringlist into a single string with each element separated by \fIsep.\fR.PPSee also split()..SH "void QStringList::sort ()"Sorts the list of strings in ascending order..PPSorting is very fast. It uses the Qt Template Library's efficient HeapSort implementation that operates in O(n*log n)..SH "QStringList QStringList::split ( const QChar & sep, const QString & str, bool allowEmptyEntries = FALSE ) \fC[static]\fR"Splits the string \fIstr\fR using \fIsep\fR as separator. Returns the list of strings. If \fIallowEmptyEntries\fR is TRUE, also empty entries are inserted into the list, else not. So if you have a string 'abc..d.e.', a list which contains 'abc', 'd', and 'e' would be returned if \fIallowEmptyEntries\fR is FALSE, but a list containing 'abc', '', 'd', 'e' and '' would be returned if \fIallowEmptyEntries\fR is TRUE. If \fIstr\fR doesn't contain \fIsep,\fR a stringlist with one item, which is the same as \fIstr,\fR is returned..PPSee also join()..SH "QStringList QStringList::split ( const QRegExp & sep, const QString & str, bool allowEmptyEntries = FALSE ) \fC[static]\fR"Splits the string \fIstr\fR using the regular expression \fIsep\fR as separator. Returns the list of strings. If \fIallowEmptyEntries\fR is TRUE, also empty entries are inserted into the list, else not. So if you have a string 'abc..d.e.', a list which contains 'abc', 'd', and 'e' would be returned if \fIallowEmptyEntries\fR is FALSE, but a list containing 'abc', '', 'd', 'e' and '' would be returned if \fIallowEmptyEntries\fR is TRUE. If \fIstr\fR doesn't contain \fIsep,\fR a stringlist with one item, which is the same as \fIstr,\fR is returned..PPSee also join()..SH "QStringList QStringList::split ( const QString & sep, const QString & str, bool allowEmptyEntries = FALSE ) \fC[static]\fR"Splits the string \fIstr\fR using \fIsep\fR as separator. Returns the list of strings. If \fIallowEmptyEntries\fR is TRUE, also empty entries are inserted into the list, else not. So if you have a string 'abc..d.e.', a list which contains 'abc', 'd', and 'e' would be returned if \fIallowEmptyEntries\fR is FALSE, but a list containing 'abc', '', 'd', 'e' and '' would be returned if \fIallowEmptyEntries\fR is TRUE. If \fIstr\fR doesn't contain \fIsep,\fR a stringlist with one item, which is the same as \fIstr,\fR is returned..PPSee also  join()..SH "SEE ALSO".BR http://doc.trolltech.com/qstringlist.html.SH COPYRIGHTCopyright 1992-2000 Trolltech AS, http://www.trolltech.com/.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -