QModelIndex sourceIndex
= QFSMfilenameView
->setRootPath
(qsPath
);
// gives a model index on the original model QModelIndex proxyIndex
= filenameSortFilterModel
->mapFromSource
(sourceIndex
);
// converts that to an index on the proxy // do something with the view(s) using the proxy index
ui->filenameListView->setRootIndex(proxyIindex);
QModelIndex sourceIndex = QFSMfilenameView->setRootPath(qsPath); // gives a model index on the original model
QModelIndex proxyIndex = filenameSortFilterModel->mapFromSource(sourceIndex); // converts that to an index on the proxy
// do something with the view(s) using the proxy index
ui->filenameListView->setRootIndex(proxyIindex);
To copy to clipboard, switch view to plain text mode
You need the index on the proxy because those are the indexes the view(s) you have attached to the proxy will see and use.
Bookmarks