When I select items in QTableWidget
, it looks like this:
But when I focus other widget, it looks like this:
I want the items to remain blue as long as they're selected. I tried to enforce it using QSS (CSS):
QListWidget::item:selected:active, QListWidget::item:selected:!active {
background: blue;
}
QListWidget::item:selected {
background: blue;
}
Didn't help. What can I do to prevent selected items from becoming gray?
Turns out that background:
is not the correct property to change selection background. This is correct:
QTableView::item:selected:!active
{
/*selection-background-color: #3399ff;*/
selection-background-color: #93CAFF;
/** doesnt work **/
color: white;
}
The text color setting still doesn't work, but it's better than nothing.