My code below will display the whole file system. I just want to display a subfolder (ex D:\folder1), with all it's contents.
I tried setting the root index of the treeView but this will hide the folder (only the contents of the folder1 will be shown).
I also tried using "setFilterRegExp()" and "setFilterKeyColumn()", but this approach will also NOT work because it will filter the parents as well.
I also tried subclassing the QSortFilterProxy" but that seems a little too much for what I'm trying to achieve.
Is there an easier method here?
Qt Code:
int main(int argc, char *argv[]) { proxyModel->setSourceModel(model); leftTree->setModel(proxyModel); splitter->show(); return a.exec(); }To copy to clipboard, switch view to plain text mode
Bookmarks