Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | Related Functions

QStringList Class Reference

The QStringList class provides a list of strings. More...

Inheritance diagram for QStringList:
Inheritance graph
[legend]
Collaboration diagram for QStringList:
Collaboration graph
[legend]

List of all members.

Public Types

typedef const value_typeconst_pointer
typedef const value_typeconst_reference
typedef const_iterator ConstIterator
typedef ptrdiff_t difference_type
typedef iterator Iterator
typedef value_typepointer
typedef value_typereference
typedef int size_type
typedef QString value_type

Public Member Functions

void append (const QString &t)
void append (const QList< QString > &t)
const QStringat (int i) const
QStringback ()
const QStringback () const
iterator begin ()
const_iterator begin () const
void clear ()
const_iterator constBegin () const
const_iterator constEnd () const
QBool contains (const QString &t) const
QBool contains (const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
int count (const QString &t) const
int count () const
void detach ()
bool empty () const
iterator end ()
const_iterator end () const
bool endsWith (const QString &t) const
iterator erase (iterator pos)
iterator erase (iterator first, iterator last)
QStringList filter (const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QStringList filter (const QRegExp &rx) const
QStringfirst ()
const QStringfirst () const
QStringfront ()
const QStringfront () const
int indexOf (const QRegExp &rx, int from=0) const
int indexOf (QRegExp &rx, int from=0) const
int indexOf (const QString &t, int from=0) const
void insert (int i, const QString &t)
iterator insert (iterator before, const QString &t)
bool isDetached () const
bool isEmpty () const
QString join (const QString &sep) const
QStringlast ()
const QStringlast () const
int lastIndexOf (const QRegExp &rx, int from=-1) const
int lastIndexOf (QRegExp &rx, int from=-1) const
int lastIndexOf (const QString &t, int from=-1) const
int length () const
QList< QStringmid (int pos, int length=-1) const
void move (int from, int to)
bool operator!= (const QList< QString > &l) const
QList< QStringoperator+ (const QList< QString > &l) const
QStringList operator+ (const QStringList &other) const
QList< QString > & operator+= (const QList< QString > &l)
QList< QString > & operator+= (const QString &t)
QList< QString > & operator<< (const QList< QString > &l)
QStringListoperator<< (const QStringList &l)
QStringListoperator<< (const QString &str)
bool operator== (const QList< QString > &l) const
const QStringoperator[] (int i) const
QStringoperator[] (int i)
void pop_back ()
void pop_front ()
void prepend (const QString &t)
void push_back (const QString &t)
void push_front (const QString &t)
 QStringList (const QList< QString > &l)
 QStringList (const QStringList &l)
 QStringList ()
 QStringList (const QString &i)
int removeAll (const QString &t)
void removeAt (int i)
int removeDuplicates ()
void removeFirst ()
void removeLast ()
bool removeOne (const QString &t)
void replace (int i, const QString &t)
QStringListreplaceInStrings (const QRegExp &rx, const QString &after)
QStringListreplaceInStrings (const QString &before, const QString &after, Qt::CaseSensitivity cs=Qt::CaseSensitive)
void setSharable (bool sharable)
int size () const
void sort ()
bool startsWith (const QString &t) const
void swap (int i, int j)
QString takeAt (int i)
QString takeFirst ()
QString takeLast ()
QSet< QStringtoSet () const
std::list< QStringtoStdList () const
QVector< QStringtoVector () const
QString value (int i, const QString &defaultValue) const
QString value (int i) const

Static Public Member Functions

static QList< QStringfromSet (const QSet< QString > &set)
static QList< QStringfromStdList (const std::list< QString > &list)
static QList< QStringfromVector (const QVector< QString > &vector)

Public Attributes

QListData::Datad
QListData p

Friends

class const_iterator
class iterator

Related Functions

(Note that these are not member functions.)


QDataStreamoperator<< (QDataStream &out, const QStringList &list)
QDataStreamoperator>> (QDataStream &in, QStringList &list)
 QMutableStringListIterator
 QT_BEGIN_NAMESPACEQStringListIterator

Detailed Description

The QStringList class provides a list of strings.

QStringList inherits from QList<QString>. Like QList, QStringList is {implicitly shared}. It provides fast index-based access as well as fast insertions and removals. Passing string lists as value parameters is both fast and safe.

All of QList's functionality also applies to QStringList. For example, you can use isEmpty() to test whether the list is empty, and you can call functions like append(), prepend(), insert(), replace(), removeAll(), removeAt(), removeFirst(), removeLast(), and removeOne() to modify a QStringList. In addition, QStringList provides a few convenience functions that make handling lists of strings easier:

Definition at line 66 of file qstringlist.h.


The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index