QTreeView remove decoration/expand button for all items

大兔子大兔子 提交于 2019-12-05 02:56:36

This is what I've done in the past for this problem, it's a bit of a hack but it's worked pretty well. In this case none.png doesn't exist.

treeView->setStyleSheet( "QTreeView::branch {  border-image: url(none.png); }" );

See https://forum.qt.io/topic/4767/how-to-get-rid-of-expande-collapse-qtreewidgetitem-indicator

This got rid of the top level ones for me: self.setRootIsDecorated(False).

I didn't try the item polocy mentioned so I'm not sure this answer can be considered complete. If anyone can verify, feel free to edit this with the confirmation. Until then consider this answer an info-share.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!