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

QFileSystemModel sorts . and .. not perfectly

XMLWordPrintable

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

      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.

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

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

              Created:
              Updated:

                There are no open Gerrit changes