[Interest] Set QTreeWidgetItem style

Sensei senseiwa at gmail.com
Tue Sep 4 11:53:32 CEST 2012

On 9/4/12 11:37am, Joseph Crowell wrote:
> On 9/4/2012 5:59 PM, Sensei wrote:
>> Dear all,
>> as usual, I am playing with tree widgets. Now I'm facing this problem:
>> Is it possible to set CSS styles on some widget items? For example,
>> items that have no valid parent, or items named "foobar".

> try widgetName->setStyleSheet("#widgetName {your css }") and check the
> help documentation for Style Sheets.

I've read the documentation, and it seems that I can set global styles 
(for the whole QTreeWidget), not specific to some items in the tree.

I mean, I need to set the style for one particular QTreeWidgetItem, 
which isn't actually a widget, and does not have a setStyleSheet method.

Is this possible, or do I need to override the paint? I'd desist if I 
have to paint myself...

More information about the Interest mailing list