Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
5.15.1
-
None
-
windows 10
-
-
f353519e78380c04cffecfa4ceef222f37e8d83a (qt/qtbase/dev) 1a33e443903b9c61e49bcb3247340a85c58ca286 (qt/qtbase/5.15)
Description
As explained hereĀ : https://stackoverflow.com/questions/64700528/qdiriterator-windows-should-be-case-insensitive-but-not
I have a directory with 2 files: Test1.txt and test2.txt
This code should list me the two files:
QDirIterator *it; QStringList nameFilters; nameFilters << "t*.txt"; QString path = "C:/temp/test"; qDebug() << "nameFilters" << nameFilters; it = new QDirIterator(path, nameFilters, QDir::NoFilter, QDirIterator::Subdirectories); while (it->hasNext()) { QString filename = it->next(); qDebug() << "filename" << filename; }
but the output is :
nameFilters ("t*.txt") filename "C:/temp/test/test2.txt"
Note that this code works well:
QDir dir(path);
qDebug() << "entryList" << dir.entryList(nameFilters, QDir::NoFilter);
Outputs for QDir :
entryList ("Test1.txt", "test2.txt")