Opened 9 years ago

Closed 9 years ago

Last modified 5 years ago

#238 closed defect (fixed)

QFileSystemModel incorrectly sorts directories

Reported by: rudi Owned by:
Priority: major Milestone: Qt 5
Component: QtGui Version:
Severity: low Keywords:


QFileSystemModel doesn't make sure, that the "." and ".." entries are reported first. So directories starting with an exclamation mark get listed before them.

Attachments (1)

qfilesystemmodel.diff (1.0 KB) - added by rudi 9 years ago.
Modified sorting

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by rudi

Attachment: qfilesystemmodel.diff added

Modified sorting

comment:1 Changed 9 years ago by Dmitry A. Kuminov

Milestone: Qt 4.7Qt

Why/where do you need this? These pseudo directories are supposed to be hidden by the file dialogs anyway.

comment:2 Changed 9 years ago by rudi

They actually show up in Qt Creator's File System View and other apps that use a QFileSystemModel instead of standard file dialogs. Because of it's generic nature it's probably something to be discussed with the Nokia people...

comment:3 Changed 9 years ago by Dmitry A. Kuminov

Yes, right, now I see the problem (in Qt Creator, on OS/2, Windows and Linux). I think you chose the right place to fix it, it's a generic problem indeed.

Discussing such things with Nokia people is good per se (and can be easily done through their IRC channels, e.g. #qt-labs on, there is also a channel for Qt Creator). But in this case I don't see any arguments that they could throw against this fix so I think I will just apply it (it will get discussed anyway once we finally request merging).

The fact that the problem doesn't appear in the standard file dialogs is just because (I already mentioned) "." and ".." get filtered out by them. However, other consumers of QFileSystemModel apparently don't do that.

comment:4 Changed 9 years ago by Dmitry A. Kuminov

Done in r1027.

comment:5 Changed 9 years ago by Dmitry A. Kuminov

Resolution: fixed
Status: newclosed

comment:6 Changed 5 years ago by Silvan Scherrer

Milestone: Qt 4.nextQt 5

Milestone renamed

Note: See TracTickets for help on using tickets.