How do you reset the background of a QTreeWidgetItem?
I know how to set the background to another color - setBackground(0, QColor(202, 224, 232, 255)); - but putting it back?![]()
How do you reset the background of a QTreeWidgetItem?
I know how to set the background to another color - setBackground(0, QColor(202, 224, 232, 255)); - but putting it back?![]()
Try:
Qt Code:
To copy to clipboard, switch view to plain text mode
J-P Nurmi
aliks-os (30th January 2016), supergillis (3rd August 2008)
Works like a charm
Thanks!
But now, when using sorted QTreeWidget, the item with another brush gets sorted in front.
Example:
I got a music list. That list contains songs of AC/DC. You got the song 'Thunderstruck' and 'Back in Black'. When you order the tree on artist, and you play the song 'Thunderstruck' it changes the background color to green and 'Thunderstruck' suddenly pops in front of 'Back in Black'... If you know what I mean...
I tried resorting after changing the brush but that doesn't make any difference.
Could you prepare a minimal compilable example which reproduces the problem?
J-P Nurmi
Bookmarks