Doc: provide a code example of QDirIterator's nameFilters parameter
Change-Id: I56f9251f17bab0f835979a5feadec1fa896c9d69 Pick-to: 5.15 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
This commit is contained in:
parent
7127bf1d04
commit
0c52e600b3
@ -69,3 +69,7 @@ while (it.hasNext()) {
|
||||
qDebug() << f.fileName() << f.readAll().trimmed().toDouble() / 1000 << "MHz";
|
||||
}
|
||||
//! [1]
|
||||
|
||||
//! [2]
|
||||
QDirIterator audioFileIt(audioPath, {"*.mp3", "*.wav"}, QDir::Files);
|
||||
//! [2]
|
||||
|
@ -462,10 +462,15 @@ QDirIterator::QDirIterator(const QString &path, IteratorFlags flags)
|
||||
By default, \a flags is NoIteratorFlags, which provides the same behavior
|
||||
as QDir::entryList().
|
||||
|
||||
For example, the following iterator could be used to iterate over audio
|
||||
files:
|
||||
|
||||
\snippet code/src_corelib_io_qdiriterator.cpp 2
|
||||
|
||||
\note To list symlinks that point to non existing files, QDir::System must be
|
||||
passed to the flags.
|
||||
|
||||
\sa hasNext(), next(), IteratorFlags
|
||||
\sa hasNext(), next(), IteratorFlags, QDir::setNameFilters()
|
||||
*/
|
||||
QDirIterator::QDirIterator(const QString &path, const QStringList &nameFilters,
|
||||
QDir::Filters filters, IteratorFlags flags)
|
||||
|
Loading…
Reference in New Issue
Block a user