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

QFileSystemModel sorts . and .. not perfectly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.7.1
    • GUI: Other
    • None
    • Linux/Wayland, Windows

    Description

      By default QFileSystemModel does not show . and .. items, but it does with setFilter(QDir::AllEntries | QDir::AllDirs). QFileSystemModel sorts items using QFileSystemModelSorter. QFileSystemModelSorter does not treat . and .. as special items and sort them along with other directories lexicographically, which means that if directory contains subdirectories with names that starts for example with parenthesis this subdirectories will be displayed above . and ..
      In attachement program that demonstrates this issue, screenshot and suggested patch.

      Attachments

        1. issue.png
          issue.png
          7 kB
        2. main.cpp
          0.7 kB
        3. qfilesystemmodel.patch
          2 kB
        4. qfilesystemmodel-sort-issue.pro
          0.1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            mugiseyebrows Stanislav Doronin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes