17int main(
int argc,
char **argv)
44 return new CustomFileEngineIterator(
filters, filterNames);
58 entries <<
"entry1" <<
"entry2" <<
"entry3";
63 return index < entries.size() - 1;
76 return entries.at(
index);
QString currentFileName() override
QString next() override
This pure virtual function advances the iterator to the next directory entry, and returns the file pa...
CustomIterator(const QStringList &nameFilters, QDir::Filters filters)
bool hasNext() const override
This pure virtual function returns true if there is at least one more entry in the current directory ...
\inmodule QtCore \reentrant
The QAbstractFileEngineIterator class provides an iterator interface for custom file engines.
QDir::Filters filters() const
Returns the entry filters for this iterator.
QStringList nameFilters() const
Returns the name filters for this iterator.
virtual QString currentFilePath() const
Returns the path to the current directory entry.
\inmodule QtCore \reentrant
The QApplication class manages the GUI application's control flow and main settings.
static int exec()
Enters the main event loop and waits until exit() is called, then returns the value that was set to e...
\macro QT_RESTRICTED_CAST_FROM_ASCII
QAbstractFileEngine * create(const QString &fileName) const override
[0]
const QStringList filters({"Image files (*.png *.xpm *.jpg)", "Text files (*.txt)", "Any files (*)" })
[6]
QApplication app(argc, argv)
[0]