Reputation: 2214
is possible to make a QFileSystemModel
in a QTreeWidget
only showing folders in a path without their subfolders? also, can i get the folders size (with anything in them) using QFileSystemModel
?
this is my code filtering to only folders:
m_index = r"C:/folder"
model = QtGui.QFileSystemModel()
model.setRootPath(m_index)
model.setFilter(QtCore.QDir.Dirs|QtCore.QDir.NoDotAndDotDot)
view = QtGui.QTreeView()
view.setModel(model)
view.setColumnHidden(2, True)
view.setColumnHidden(3, True)
view.setRootIndex(model.index(m_index))
Upvotes: 0
Views: 916