Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to hide the content from a directory in QFileSystemModel
Laurent Schall last edited by
I am using the QFileSystemModel model data model for the local filesystem.
I would like to hide the content from a specific directory - not the name of the directory itself, but solely it content (files and sub-directories). I assume that setting a filter is not going to work, so that I will have to subclass some of the functions inherited QAbstractItemModel.
What would be the best way to archive that.
JonB last edited by
You can subclass from
QFileSystemModel, which should be used to achieve this, so why think about dropping down to
VRonin last edited by
QFileSystemModel, and reimplement both
hasChildren()to rerurn 0/false for the foder you want to hide the contents of
QIdentityProxyModel, modify it as you want (i.e. what the fellows above suggested) and attach it to the standard