QFileSystemModel limit folder depth
Unsolved
Qt for Python
-
I want to limit folder depth using QFileSystemModel.
e.g. C:\folder1\folder2\folder3Using the QStandardItemModel, folders could be explored one by one.
However, I prefer the fast speed of the QFileSystemModel and I also like the automatic creation of icons.
Please let me know if there is a way to limit the depth of the folder in the QFileSystemModel.
Thank you. -
@Lucas-kim
There isn't an in-built support inQFileSystemModel
for this. What about:QTreeView QFileSystemModel - limit expandable to only root
Use some proxy model to limit depth via
hasChildren()
/rowCount()
. ?