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

QFileSystemModel not suited well as QDirModel replacement

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.4.1
    • Core: Item Models
    • None
    • Windows
      Mac OS X
    • macOS

    Description

      In my application (image browser/viewer for Windows and OS X) I create permanent 'Folders' panel with folders view to easy assess to different folder by user.

      I tried to use QFileSystem model (+QTreeView) and was forced to go to (deprecated) QDirModel because QFileSystemModel is not suited for 'live' (changing) filesystem. QFileSystemModel agressively caches all folders and there is no way to flush part of this cache, only delete and re-create the model.

      There is two ways for fixing it:
      a) implement refresh() call, like QDirModel::refresh(), to flush part of cached folders tree. In this case, it is possible update model data by external filesystem change monitoring.

      or

      b) implement internal monitoring for changing filesystem:

      • directory change watcher for every cached node, not single watcher for root path, this is not enough
      • (Windows) drive letter added/removed monitoring
      • media change monitoring (most annoying under windows, because it needs polling, no callbacks from system)

      Attachments

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

        Activity

          People

            dfaure_kdab David Faure
            alextutubalin Alex Tutubalin
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes