Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-88227

QDirIterator (Windows) should be case insensitive but not

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.15.1
    • Core: I/O
    • None
    • windows 10
    • Windows
    • 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")

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            jlbrd Biord Jean-Luc
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes