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

QFileSystemModel requests icons for filtered files

XMLWordPrintable

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

      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.

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

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

              Created:
              Updated:

                There are no open Gerrit changes