Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QTreeView remove decoration/expand button for all items

Tags:

qt

qtreeview

I want to have my QTreeView always expanded all of the items. In that case, all expand button / decoration are unnecessary and I want get rid of them. How can I delete all of them? setRootIsDecorated will only delete that buttons on first level...

like image 726
GwynBleidD Avatar asked Apr 15 '13 15:04

GwynBleidD


1 Answers

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); }" );
like image 172
Chris Avatar answered Nov 15 '22 21:11

Chris