How can I remove columns from a QTreeView (using QDirModel)?
I have a QDirModel attached to a QTreeView and I only want to see the paths, not size, type and date modified.
Is there a way to remove these columns开发者_运维知识库?
QTreeView::setColumnHidden(int column, bool hide)
should do the trick.
One can also use hideColumn()
. Something like:
for i in range(1, self.my_tree_view.header().length()):
self.my_tree_view.hideColumn(i)
精彩评论