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

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

XMLWordPrintable

      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.

        For Gerrit Dashboard: QTBUG-87588
        # Subject Branch Project Status CR V

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes