Reputation: 61
I want to change the colors of the Table Widget in PyQt5 in those two places, but couldn't find how:
Here's my style sheet so far:
QTableView QHeaderView::section
{
background-color:rgb(48, 48, 72);
color:white;
}
QTableView QHeaderView::section:checked
{
background-color: rgb(48, 48, 72);
color:white;
}
QTableView QTableCornerButton::section {
Background-color:rgb(48, 48, 72);
}
QTableView,QListView::section {
Background-color:rgb(48, 48, 72);
}
Upvotes: 0
Views: 851
Reputation: 4286
QTableView QHeaderView {}
sets the properties of the HeaderView without sections
QTableView QHeaderView::section {}
the one of the HeaderViews sections, even of the checked ones, if no different properties for them are set. So you only need to replace the first line of your code by
QTableView QHeaderView, QTableView QHeaderView::section
the section
QTableView QHeaderView::section:checked {}
is only needed, if checked sections shall have different properties
so you can ease your code to
QTableView, QTableView QHeaderView,
QTableView QHeaderView::section, QTableView QTableCornerButton:section
{
background-color:rgb(48, 48, 72);
color:white;
}
and only if needed
QTableView QVerticalHeaderView::section:checked
{
background-color:rgb(255, 0, 0);
color:white;
}
Upvotes: 2