0

I am trying to make a QListView where it only shows specific folders on my computer. Note that the folders can be in separate directories. I am using QFileSystemModel for my QListView, but cannot find a method that appends a folder to the end of my QFileSystemModel. I am aware that I can filter, but that does not solve my problem, because the folders that I want to appear is not in the QFileSystemModel.

For example, here is a folder that I want to show and one that I do not want to show:

enter image description here

and inside the folder folder that I want to hide, there is a file I do not want to show and a folder that I do want to show:

enter image description here

Is there a way to force my QFileSystemModel to include specific folders anywhere on my computer?

Evan Zhao
  • 70
  • 1
  • 7
  • What do you mean by "is not in the QFileSystemModel"? If the folder is on your computer it means that it "exists" for the model. Have you checked this? [How to use QFileSystemModel to filter multiple directories and show them on QTreeView?](https://stackoverflow.com/questions/47266719/how-to-use-qfilesystemmodel-to-filter-multiple-directories-and-show-them-on-qtre) Note that that answer seems to have some issues (probably due to the delayed loading the model uses, which probably needs a more accurate implementation of [`fetchMore()`](https://doc.qt.io/qt-5/qfilesystemmodel.html#fetchMore). – musicamante Apr 15 '20 at 07:23
  • provide a [mre] – eyllanesc Apr 15 '20 at 13:10
  • @eyllanesc hmm... I am not sure what code to include. My problem is not a bug, but a lack of understanding on how to add a path to QFileSystemModel. – Evan Zhao Apr 15 '20 at 21:04

0 Answers0