[Qt-interest] customize the root node of a treeview

Shi Yan billconan at gmail.com
Tue Nov 10 09:08:18 CET 2009


hello guys,

i want to customize my treeview with style sheet. but i discovered
that the root node items cannot be customized. the background is
always gray.

i'm setting the background of my treeview like this:

QTreeView {
alternate-background-color: yellow;
background-color:black;
}

QTreeView::item {
background-color:red;
}

but this only affects on the normal tree nodes.

i'm attaching a picture, those i circled in red are the node items
that i want to customize.

is there anybody having done this before?

the picture can be seen here
http://www.qtcentre.org/forum/f-qt-programming-2/t-customize-the-root-node-of-a-treeview-25521-post122054.html#post122054

thanks.



More information about the Qt-interest-old mailing list