QSortFilterProxyModel - get root path
General and Desktop
3
Posts
2
Posters
1.7k
Views
1
Watching
-
wrote on 25 Sept 2012, 18:36 last edited by
How can I get the root path of a QSortFilterProxyModel that uses QFileSystemModel as its source model?
I tried the following in an QSortFilterProxyModel-based class but it does not seem to work:
@
((QFileSystemModel)sourceModel()).rootPath()
@ -
wrote on 25 Sept 2012, 19:47 last edited by
Iterate up to the root node, and get the path there through the appropriate role?
-
wrote on 25 Sept 2012, 21:41 last edited by
I tried but I cannot seem to get the string rootpath correctly. Thus I connected a slot to the rootPathChanged signal for the QFileStringModel and set a QString rootPath variable I delcared.
@
void MainWindow::fsModel_rootPathChanged(QString str)
{
m_checkProxy->rootPath = str;
}
@NOTE: still don't know why I was unable to get it using the rootPath
Thanks for your response...
1/3