Exclude files with QFileInfoList filter
-
Hello,
When using QFileInfoList + QDir, can we filter anythinbg that should be excluded (or does the filtering is only on what is included) ?
For example:- Can I filter the . , .. files (so that they are excluded from list) ?
- Can I filter all files that have some substr in the name such as "garbage" string: xxx_garbage_xxx (so that they are excluded from list) ?
Thank you,
Ran -
As the "documentation":http://doc.qt.io/qt-5/qdir.html#entryInfoList suggests: yes, you can filter the results as you wish.
Example:
@
QFileInfoList list = dir.entryInfoList("*.exe", QDir::NoDotAndDotDot | QDir::Files);// or just
QFileInfoList list = dir.entryInfoList(QDir::NoDotAndDotDot | QDir::Files);
@