QTreeWidgetItem setDecorated False
-
Hi, I'm using PyQt4, but it should be very similar to C++.
I'm hiding the expand / collapse symbols in the QTreeWidget by calling setRootIsDecorated. How do I hide the decorations for the whole tree, not just the root? I've tried QTreeWidgetItem.setChildIndicatorPolicy(QTreeWidgetItem.DontShowIndicator), but this collapses the children, even when I've expanded them. What is setRootIsDecorated doing under the hood to just hide the + / - symbols and nothing else?
Thank you. -
you can use a "stylesheet":http://qt-project.org/doc/qt-4.8/stylesheet-examples.html#customizing-qtreeview to hide the branch-indicators with an invalid/transparent image.
-
Thanks for your help. I got this working.
I have a follow-up question. Since it turns out the table doesn't look that great with a blank space there, how would I use the default branch-more.png or branch-end.png as a replacement? When I try putting in the URLs from the example it's still blank. Probably because it can't find the image url.
I'm extending the interface of a 3rd party application, so I'm trying to figure out how to use their default images rather than make my own .pngs. I thought I might be able to get their existing style sheet by calling the styleSheet() method on my QTreeWidget or maybe its parents, but everything was just empty strings. -
probably they have set it on the QApplication instance?
-
This is what I get from QApplication.instance().styleSheet().
I guess it would be QApplication::instance()->styleSheet() in C++.@
*{
selection-color: rgb(0, 0, 0);
selection-background-color: rgb(37, 200, 25);
color: white;
}
QToolTip{ color: black;}
*:disabled{color:rgb(30, 30, 30);}
@
Looks like they're only changing colors. However, the default Windows 7 expand / collapse icons look like arrows, while the ones I get look like + and - symbols. Not sure if there's an easy way to find where these icons are. Maybe it would make more sense for me to ask their support about that instead.