PDA

View Full Version : QFileSystemModel has no sorting



mpi
27th May 2009, 15:18
Hey,

The class QFileSystemModel does not have any sorting method. The non-threaded counterpart QDirModel, however, has this feature, namely

void setSorting ( QDir::SortFlags sort )

The problem is that the directory from QFileSystemModel is displayed in what appears to be a completely random order.

Any clues?

faldzip
27th May 2009, 15:46
What happens if you just use QAbstractItemModel::sort() on your QFileSystemModel?
If it doesn't work then you can use QSortFilterProxyModel.

mpi
28th May 2009, 08:17
Thanks.

I just find it strange that QDirModel has the entire range of sortings enabled as you would expect, but this class hasn't.

Mads

wysota
28th May 2009, 09:14
That's one of the reasons QDirModel is slow and QFileSystemModel is fast :-)