开发者

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)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜