Windows Tree View
-
I made a treeView/QFileSystemModel to show directory structure.
When I set root index as following,
QTreeView *treeView = new QTreeView(this);
treeView->setRootIndex(treeView->model()->index(-1,-1));
it show only drive letters as you can see the left hand side of attached
picture.
Does anyone know how I show the directory structure like the right hand side of picture?
Thank you. -
I made a treeView/QFileSystemModel to show directory structure.
When I set root index as following,
QTreeView *treeView = new QTreeView(this);
treeView->setRootIndex(treeView->model()->index(-1,-1));
it show only drive letters as you can see the left hand side of attached
picture.
Does anyone know how I show the directory structure like the right hand side of picture?
Thank you.Did you try http://doc.qt.io/qt-5.7/qtreeview.html#setExpanded ?
-
I made a treeView/QFileSystemModel to show directory structure.
When I set root index as following,
QTreeView *treeView = new QTreeView(this);
treeView->setRootIndex(treeView->model()->index(-1,-1));
it show only drive letters as you can see the left hand side of attached
picture.
Does anyone know how I show the directory structure like the right hand side of picture?
Thank you.@samdol
thats not possible directly, since they are "Windows specific".
You can create a custom proxy model (around the QFileSystemModel) and insert them yourself.
But i don't know if the exact same view is even achievable.