PDA

View Full Version : How to display folders and files in listView



smallB
24th August 2015, 12:13
How to display folders and files in listView but also, how to include dot and dot dot paths. I can simply display files and folders using QFileSystemModel, but dot dot is not being displayed.
Thanks for any hjalp.

prasad_N
24th August 2015, 17:15
have a look at Fetch more example in Qt examples, I remember i could see . & .. in that example.

anda_skoa
25th August 2015, 07:42
The QFileSystemModel is usually intended to be used with a tree view, so it doesn't need the dot and dotdot entries for navigation.
You could try resetting the filter (setFilter) so that these two are part of the allowed set.

If that does not work, I would suggest a simple custom list model that uses QDir::entryList/entryInfoList internally.

Cheers,
_