while I'm working on something in Qt5 that closely resembles a file manager, I try to implement a very basic tree view, showing only the directory names without any other information. However, (it seems that) QTreeView
doesn't let me decide which columns I want to show.
Here's what I have:
// ...
QString m_path = "C:/Users/mine";
dirModel = new QFileSystemModel(this);
dirModel->setFilter(QDir::NoDotAndDotDot | QDir::AllDirs);
dirModel->setRootPath(m_path);
ui->treeView->setModel(dirModel);
// ...
Now my QTreeView
shows more information with the name, like the size et al.; however, this is not the desired behavior.
Setting headerVisible
to false
removes the "headline" of my QTreeView
which is OK, but how can I remove the other columns completely? I tried:
ui->treeView->hideColumn(1);
just to test if that works, but it did not change a thing.