I have two folders in program directory. I need them to show in tree view, they should be expandable. How can I define what folder will be in tree view? If anyone canshow me an easy example. I know names of folders.
I´m using Python 2.7 and Win 8.
I have two folders in program directory. I need them to show in tree view, they should be expandable. How can I define what folder will be in tree view? If anyone canshow me an easy example. I know names of folders.
I´m using Python 2.7 and Win 8.
You can do that with QTreeView
and QFileSystemModel
:
model = QFileSystemModel();
model.setRootPath(QDir.currentPath())
tree = QTreeView()
tree.setModel(model)
tree.setRootIndex(model.index(QDir.currentPath()))
tree.show()