How to keep background-color of QTavbeView when it lose the focus?
-
For instance,i click a row of QTableView,and the background-color of this row change to blue;
And then,i click the button "Find" to lanuch a dialog,QTabelView lose the focus,and the background-color of row that's checked is change to white.
How to keep background-color of QTavbeView when it lose the focus?
I try to use QSS,but it doesn't work
QString tableviewStyleStr = "QTableView::item:selected {background - color: #1E90FF; color: white;} "; tableviewStyleStr += "QTableView::item:selected:!active{background - color: #1E90FF; color: white;} "; tableview_student->setStyleSheet(tableviewStyleStr);

-
Hi,
You can alter the palette of your QTableView to modify the colors in the inactive state.
This StackOverflow answer shows it.
-
Q qazaq408 has marked this topic as solved on