[Interest] Customize QTableView selection color

Murphy, Sean smurphy at walbro.com
Fri Feb 5 17:39:48 CET 2016


> If I understand you correctly, you basicaly want the color of the row to be whatever it was before it was selected, right?
> 
> Can't you just use a QProxyStyle and reset the selected flag from the style option before you pass on the render command to the underlying style?  Have the selection work, but not be visible. A QStyledItemDelegate doing a similar trick 
> would work as well. Just make a copy of the style option, reset the selection flag in the state variable, and pass that on to the base class. 

I'll try that. As I said in the post I made on January 29th, I was completely getting lost between who's responsibility it is to customize these things: stylesheets, QStyle, QStyledItemDelegate, the model, the view itself, etc. So this is helpful to at least get thing narrowed down.

Sean


More information about the Interest mailing list