[Qt-interest] QFileSystemModel and QTreeView issue (all elements are shown as collapsible)

Luis Ángel San Martín valimaki_ketola at hotmail.com
Sun Apr 10 09:22:31 CEST 2011


Hello,

I have implemented a file browser with a couple of QFileSystemModel, a QSortFilterProxyModel and two views: a QTreeView to show folders structure, and a QListView for showing files in the selected folder. The QSortFilterProxyModel is used for filtering folders by name in the QTreeView.

Here is my problem: after calling foldersModel->setRootPath() the view is updated to show the root index ( foldersView->setRootIndex(...) ), then, the view shows the folders in the root path, but every element in the tree is shown as a collapsible element, even if it doesn't have any children. Delaying the call to setRootIndex after the signal directoryLoaded(QString) is emitted doesn't help. How can I solve that? Is that the expected behaviour?

Best regards.


 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110410/4447f631/attachment.html 


More information about the Qt-interest-old mailing list