Users open files in our application through QFileDialog. The file name order is fancy. What determines the sort order and how can we sort it by file name or otherwise impose our own sort, possibly indicating its own comparison function?
Documentation and online forums did not help. If it is not hidden, there is no sorting method, property, etc.
This is the main application for Linux, but also works on Mac computers. (I don't know anything about the Mac.)
Here is the juicy part of the source code:
QtFileDialog chooser(parent, caption, directory, filter);
chooser.setModal(true);
chooser.setAcceptMode(acceptMode);
chooser.setFileMode(fileMode);
QStringList hist = chooser.history();
chooser.setHistory(hist);
if(chooser.exec()) {
QStringList files = chooser.selectedFiles();
...blah blah blah...
From one of the answers, I tried an evil experiment by adding this poorly informed guess code to "point x":
QSortFilterProxyModel *sorter = new QSortFilterProxyModel();
sorter->sort(1);
chooser.setProxyModel(sorter);
33 , . , Qt4 , QSortFilterProxyModel.