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

Documentation for QFileSystemModel::setFilter is confusing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: P4: Low P4: Low
    • None
    • 4.8.3, 5.0.0 Beta 1
    • Widgets: Itemviews

      The documentation for QFileSystemModel::setFilter explains that

      Note that the filter you set should always include the QDir::AllDirs enum value, otherwise QFileSystemModel won't be able to read the directory structure.

      However, if you only want to list the files in the current root path, then QDir::AllDirs | QDir::Files also lists the directories, and omitting the QDir::AllDirs flag causes undesirable behavior, i.e. it displays folders and files some of which are not related to the current directory, in random order. And if I try to expand some of the folders, I have errors like "QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No such file or directory QFileSystemWatcher: failed to add paths: .putty"

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

            stephen.kelly Stephen Kelly (Unused account) (Inactive)
            jrabbe Jonas Rabbe
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes