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

QFileSystemModel requests icons for filtered files

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 4.8.1
    • Core: Item Models
    • None

    Description

      Consider:

        model = new QFileSystemModel();
        model->setFilter(QDir::AllEntries | QDir::NoDotAndDotDot);
        model->setNameFilters(QStringList() << "*.tiff" << "*.cbf");
        model->setNameFilterDisables(false);
        model->setIconProvider(new ThumbnailProvider);
        model->setRootPath(...);
      

      where ThumbnailProvider implements QFileIconProvider::icon(const QFileInfo& info).

      Due to the filter settings, I expected that ThumbnailProvider::icon() would get requests for "tiff" and "cbf" files only, but instead I see requests for icons for all files in the root path of the model.

      While this is not incorrect per se, performance would probably improve if no icon for filtered files would be requested/created.

      Attachments

        Issue Links

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

          Activity

            People

              dfaure_kdab David Faure
              dfranke Daniel Franke
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes