Use a proxy model for sorting.
Basically using this, i tried to play around and did something like this:
Qt Code:
proxyModel->setSourceModel(pSystemPrimaryModel); // Set the QStandardItemModel model of QTreeView to display audio and video files with details ui->PrimTreeView->setModel(proxyModel);To copy to clipboard, switch view to plain text mode
it didnt work..... Looks like I have to use some functions
Since you want to change the order of the drives only, obviously just using a proxy that sorts *everything* will not work. You need to subclass it and reimplement the comparision method taking into consideration *what* you are sorting. And I have no idea why you used QStandardItemModel instead of QFileSystemModel in the last snippet. Maybe that's why it "didn't work" (whatever that means)![]()
Bookmarks