Compatibility Members for QStringList

以下成员源于类 QStringList are part of the Qt compatibility layer. We advise against using them in new code.

公共函数

迭代器 fromLast ()
ConstIterator fromLast () const
QStringList grep (const QString & str , bool cs = true) const
QStringList grep (const QRegExp & rx ) const
QStringList & gres (const QRegExp & rx , const QString & after )
QStringList & gres (const QString & before , const QString & after , bool cs = true)
  • 7 public functions inherited from QList

静态公共成员

QStringList split (const QRegExp & sep , const QString & str , bool allowEmptyEntries = false)
QStringList split (const QChar & sep , const QString & str , bool allowEmptyEntries = false)
QStringList split (const QString & sep , const QString & str , bool allowEmptyEntries = false)

成员函数文档编制

Iterator QStringList:: fromLast ()

使用 end () 代替。

例如,若有代码像

QStringList::Iterator i = list.fromLast();
					

可以把它重写成

QStringList::Iterator i = list.isEmpty() ? list.end() : --list.end();
					

ConstIterator QStringList:: fromLast () const

使用 end () 代替。

例如,若有代码像

QStringList::ConstIterator i = list.fromLast();
					

可以把它重写成

QStringList::ConstIterator i = list.isEmpty() ? list.end() : --list.end();
					

QStringList QStringList:: grep (const QString & str , bool cs = true) const

使用 filter () 代替。

QStringList QStringList:: grep (const QRegExp & rx ) const

使用 filter () 代替。

QStringList & QStringList:: gres (const QRegExp & rx , const QString & after )

使用 replaceInStrings () 代替。

QStringList & QStringList:: gres (const QString & before , const QString & after , bool cs = true)

使用 replaceInStrings () 代替。

[static] QStringList QStringList:: split (const QRegExp & sep , const QString & str , bool allowEmptyEntries = false)

使用 QString::split ( sep , QString::SkipEmptyParts ) 或 QString::split ( sep , QString::KeepEmptyParts ) 代替。

Be aware that the QString::split ()'s return value is a QStringList that always contains at least one element, even if str is empty.

另请参阅 join () 和 QString::section ().

[static] QStringList QStringList:: split (const QChar & sep , const QString & str , bool allowEmptyEntries = false)

这是重载函数。

This version of the function uses a QChar as separator.

另请参阅 join () 和 QString::section ().

[static] QStringList QStringList:: split (const QString & sep , const QString & str , bool allowEmptyEntries = false)

这是重载函数。

This version of the function uses a QString as separator.

另请参阅 join () 和 QString::section ().