Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
src_corelib_io_qdiriterator.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
6while (it.hasNext()) {
7 QString dir = it.next();
8 qDebug() << dir;
9 // /etc/.
10 // /etc/..
11 // /etc/X11
12 // /etc/X11/fs
13 // ...
14}
16
19while (it.hasNext()) {
20 QFile f(it.next());
22 qDebug() << f.fileName() << f.readAll().trimmed().toDouble() / 1000 << "MHz";
23}
25
27QDirIterator audioFileIt(audioPath, {"*.mp3", "*.wav"}, QDir::Files);
The QDirIterator class provides an iterator for directory entrylists.
bool hasNext() const
Returns true if there is at least one more entry in the directory; otherwise, false is returned.
QString next()
Advances the iterator to the next entry, and returns the file path of this new entry.
@ Files
Definition qdir.h:23
@ NoFilter
Definition qdir.h:46
\inmodule QtCore
Definition qfile.h:93
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QList< QString > QStringList
Constructs a string list that contains the given string, str.
#define qDebug
[1]
Definition qlogging.h:164
GLfloat GLfloat f
QDirIterator audioFileIt(audioPath, {"*.mp3", "*.wav"}, QDir::Files)
[1]
QDirIterator it("/etc", QDirIterator::Subdirectories)
[0]
QString dir
[11]