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 ().