Table view: custom alternate row colors?
-
how do i get something like this?
when i try to use a style sheet, like this:tracksList->setStyleSheet("alternate-background-color: #bfffbf; background-color: #deffde;");
it colorizes the ENTIRE background including the header (sort-column) bar, and gives me non-platform scroll bars. this is supposed to be a mac (with mac scroll bars):
I just want the table view background color set, not the sort-column header nor the scroll bars. how?
-
magic!
-
holy cats you guys! that worked!
-
okay so the final part is: now that i've got the BG colors lookin sweet, suddenly the SELECTION color is all wiggy. ie: without setting the alt-rows colors, selection looks like this:
but WITH the alt-rows colors set, it looks like this?
ie: no actual selection hilight, but the text does turns white?
I actually need it to have that very dark selection look. I don't see in the doc on style sheets how to accomplish that?
-
@davecotter Hi,
Use palette instead of stylesheet so you will not have the issue with selection.QPalette p = tracksList.palette(); p.setColor(QPalette::Base, color1); p.setColor(QPalette::AlternateBase, color2); tracksList.setPalette(p);
-
magic!