PDA

View Full Version : bg color of current item for a QTreeView



joeld42
8th October 2009, 18:20
Hello!

I need to set the background color of the current cell in a QTreeView. I'd prefer to do this with QSS stylesheets, because the app is already using a lot of that.

I can do this:



MyTreeView {
selection-background-color: lightGreen;
selection-color: white;
}


But that sets the background for the whole selected row, not just the currently active cell.

thanks!

wysota
18th October 2009, 17:06
Use the "::item" subcontrol.

MyTreeView::item:active {
background-color: lightgreen;
}