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

QFileSystemModel fileInfo incorrect for root directory on Windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.0.0, 5.6.1
    • Core: I/O
    • None
    • Windows 7, Visual Studio 2015
    • Windows

    Description

      #include <QtCore/QDebug>
      #include <QtCore/QFileInfo>
      #include <QtWidgets/QApplication>
      #include <QtWidgets/QFileSystemModel>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          // Before running, execute "cd C:\Windows" at the command prompt
      
          QFileSystemModel fileSystemModel;
          auto index = fileSystemModel.index("C:/");
          qDebug() << fileSystemModel.filePath(index)
                   << fileSystemModel.fileInfo(index).absoluteFilePath()
                   << QFileInfo("C:/").absoluteFilePath();
      
          // Output:
          // "C:/" "C:/Windows" "C:/"
      
          // Expected:
          // "C:/" "C:/" "C:/"
      }
      

      Attachments

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

        Activity

          People

            cnn Qt Core & Network
            baysmith Bradley Smith
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes