Changing the color of QTreeView's branches
General and Desktop
6
Posts
3
Posters
9.1k
Views
1
Watching
-
wrote on 28 Jul 2011, 09:31 last edited by
I am trying to change the color of a selected item's branch to white
But the following stylesheet seems not working
@QTreeView::branch:selected {
color: white;
}@ -
wrote on 28 Jul 2011, 10:13 last edited by
What do you want exactly? Change the color of the selected item's text, or background?
EDIT : For the selected background you need
@QTreeView {selection-background-color: white}@ -
wrote on 28 Jul 2011, 10:16 last edited by
No, I want to change the color of the triangle (branch) on the left side of the text
-
wrote on 28 Jul 2011, 10:29 last edited by
I think you need to set the image to draw for the branch, and provide a white triangle image instead of a grey one.
-
wrote on 28 Jul 2011, 10:40 last edited by
Yes, Andre was too fast for me ;)
You can find examples in the "docs":http://doc.qt.nokia.com/4.7/stylesheet-examples.html#customizing-qtreeview.
-
wrote on 28 Jul 2011, 10:42 last edited by
Thanks Andre and Eddy!
I will set the image of the branch
1/6