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

[REG 5.15.1 -> 5.15] QFileSystemModel with QDir::NoDot filter hangs

    XMLWordPrintable

Details

    Description

      After the following change in the current 5.15 branch:

      QTreeView: fetch as many nested entries as fit into the view (I54f95552) ยท Gerrit Code Review

      The following example causes an endless hang:

      #include <QDir>
      #include <QTreeView>
      #include <QFileSystemModel>
      #include <QApplication>
      
      int main(int argc, char** argv)
      {
          QApplication app{argc, argv};
      
          QTreeView view{};
          QFileSystemModel model{};
          view.setModel(&model);
          model.setFilter(QDir::NoDot);
      
          view.show();
          return app.exec();
      }
      

      It looks like the loop added in that change (cc vhilshei dorisverria) never terminates because fetchMore always returns 1 item?

      3326	           while ((count = model->rowCount(parent)) < viewCount && model->canFetchMore(parent))
      (gdb) n
      3327	               model->fetchMore(parent);
      (gdb) n
      3326	           while ((count = model->rowCount(parent)) < viewCount && model->canFetchMore(parent))
      (gdb) n
      3327	               model->fetchMore(parent);
      (gdb) n
      3326	           while ((count = model->rowCount(parent)) < viewCount && model->canFetchMore(parent))
      (gdb) n
      3327	               model->fetchMore(parent);
      (gdb) p count
      $8 = 1
      (gdb) p parent
      $9 = {r = -1, c = -1, i = 0, m = 0x0}
      

      Not sure if this is a bug in the model (uncovered by the view change) or a bug in the views, so I added both components.

      Attachments

        Issue Links

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

          Activity

            People

              vhilshei Volker Hilsheimer
              the compiler Florian Bruhin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes