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

QTreeView using QFileSystemModel fails to display subdirectories of symlinked folder

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.0, 6.5.2
    • Core: Item Models
    • None
    • Windows 11
    • Windows

    Description

      Minimal program to reproduce:

      #include <QApplication>
      #include <QFileSystemModel>
      #include <QTreeView>
      
      int main(int argc, char *argv[])
      {
        QApplication app(argc, argv);
      
        QFileSystemModel model;
        model.setFilter( QDir::AllEntries | QDir::NoDotAndDotDot );
        model.setRootPath(QDir::currentPath());
        model.setResolveSymlinks(false);
      
        QFile::link(QDir::homePath() + "/Music", QDir::currentPath() + "/link.lnk");
      
        QTreeView tree;
        tree.setModel(&model);
        tree.setRootIndex(model.index(model.rootPath()));
      
        tree.resize(640, 480);
        tree.show();
      
        return app.exec();
      }
      

       

       

      Expanding the linked folder ("Music") shows that folders don't have icons (but they do have a little expand arrows). Attempting to expand one of the folders in "Music" does not work: what happens instead is an icon of a file is displayed next to them and size is set to -1 bytes (see attached picture)

       

      I also checked the behavior on Qt 6.5.2, and after clicking the expand arrow, it disappears but no items are shown:

      Attachments

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

        Activity

          People

            owolff Oliver Wolff
            marpan Marek Panek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes