Failing to Sort Filesystem in QTreeview via QSortFilterProxyModel
I have a QTreeview where I am displaying all system drives using QFileSystemModel. I just want to know which function of QSortFilterProxyModel class is used to sort the local and removable drives in system. Basically I am working on a app where I need to sort them in a order.
Here is the code:
[CODE]pSystemPrimaryModel = new QFileSystemModel(this);
pSystemPrimaryModel->setRootPath(QDir::currentPath());
// Sets the model for the view to present.
ui->PrimTreeView->setModel(pSystemPrimaryModel);
ui->PrimTreeView->header()->hide();[/CODE]
This displays drives in a regular manner even when removable drive is connected as follows:
[CODE]+ C:
+ New Volume(D:)
+ New Volume(E:)
+ SD_Card(F:)
+ Transcend Drive(G:)[/CODE]
Basically I want to display it like follows:
[CODE]Local Folder
C:
New Volume(D:)
New Volume(E:)
Removable Drives
SD_Card(F:)
Transcend Drive(G:)[/CODE]
Does QSortFilterProxyModel can help me achieve this or is there some other Qt Class?? If yes then I would appreciate if you could guide me :)