ok found it for those who are interested:
I use two models, one for the treeview (QDirModel) and one for the tableview (QFileSystemModel)
then when the directory is changed in the treeview, I set the setRootPath of the QFileSystemModel
Qt Code:
  1. ...
  2. QModelIndex dir = index.sibling(index.row(), 0);
  3. if (dir != fileView->rootIndex() && dirModel->isDir(dir))
  4. {
  5. currentPath = dirModel->filePath(dir);
  6. treeView->setCurrentIndex(index);
  7.  
  8. fileModel->setRootPath(currentPath);
  9. fileView->setRootIndex(fileModel->index(currentPath));
  10. }
To copy to clipboard, switch view to plain text mode