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

QStringList Class Reference

Inheritance diagram for QStringList:

QList< QString >

List of all members.

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 62 of file qstringlist.h.

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)
const QStringat (int i) const
const QStringback () const
QStringback ()
const_iterator begin () const
iterator begin ()
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
int count (const QString &t) const
void detach ()
bool empty () const
const_iterator end () const
iterator end ()
iterator erase (iterator first, iterator last)
iterator erase (iterator pos)
QStringList filter (const QRegExp &rx) const
QStringList filter (const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
const QStringfirst () const
QStringfirst ()
const QStringfront () const
QStringfront ()
int indexOf (const QString &t, int from=0) const
int indexOf (const QRegExp &rx, int from=0) const
iterator insert (iterator before, const QString &t)
void insert (int i, const QString &t)
bool isDetached () const
bool isEmpty () const
QString join (const QString &sep) const
const QStringlast () const
QStringlast ()
int lastIndexOf (const QString &t, int from=-1) const
int lastIndexOf (const QRegExp &rx, int from=-1) 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 QString &t)
QList< QString > & operator+= (const QList< QString > &l)
QList< QString > & operator<< (const QList< QString > &l)
QStringListoperator<< (const QStringList &l)
QStringListoperator<< (const QString &str)
bool operator== (const QList< QString > &l) const
QStringoperator[] (int i)
const QStringoperator[] (int i) const
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 (const QString &i)
 QStringList ()
int removeAll (const QString &t)
void removeAt (int i)
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 ()
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::Data * d
QListData p


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)

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

Generated by  Doxygen 1.6.0   Back to index