Issue with custom delegate in tableview
-
Hi,
I have issue with Highlighting cell of tableView with my own delegate (checkbox), i used this code :
@
if(option.state & QStyle::State_Selected)
{
painter->fillRect(option.rect,option.palette.highlight());
}
@this works but the problem is that when the focus of table is changed the color of selected row have to be gray but in my table the color of my delegate cells will stay dark blue(state_selected).
How to fix that?
thanks -
Hi,
Maybe add a check with QStyle::State_HasFocus ?
Hope it helps
-
Yeah that's true, but my problem is that i don't know with which palette i should paint the delegate background when it has not focus?
-
Does anyone knows how to deal with it?!
-
Isn't this something for the QPalette::Inactive color group ?