How to share one QFileSystemModel with two Views?
-
Dear all,
I'm making a simple file manager. Firstly, I make two separate QFileSystemModel to show QTreeView & QListView respectively.
But, I would like to share one QFileSystemModel between them. I try with make with QSortFilterProxyModel.
But, I don't know how to filter just the folders with QSortFilterProxyModel, plz help me.
Is there another method to get like that result.
Thanks
-
Have a look at this "wiki page":http://developer.qt.nokia.com/faq/answer/how_can_i_implement_my_own_proxy_model_that_is_more_advanced_than_just_sort.
It's almost what you want for the proxy. They use QStandardItemModel instead, but it can give you a good start.