Delete a selected folder and all sub folders in QTreeView
Unsolved
General and Desktop
-
Hello All,
I am using QTreeView with QFilesySystemModel. How can I delete a selected folder along with all it's sub folders in QTreeView?
CODE
QModelIndex index=mytreeview->currentIndex(); dirmodel->removeRows(index.row(), index.column(), index.parent());
Any suggestions??
Thanks. -
Hi,
QFileSystemModel::rmdir is what you are looking for. Beware of the warning in the documentation.
-
That wasn't really clear from your original description.
In that case, use a filter. QSortFilterProxyModel for example