我想在这两处更改PyQt5中的颜色,但无法找到如何更改:

到目前为止,这是我的样式表:
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);
}发布于 2015-12-15 19:50:15
QTableView QHeaderView {}设置不带节的HeaderView的属性
QTableView QHeaderView::section {}如果没有设置HeaderViews节的不同属性,则设置其中的一个节,即使是选中的部分。因此,您只需将代码的第一行替换为
QTableView QHeaderView, QTableView QHeaderView::section节段
QTableView QHeaderView::section:checked {}如果选中的区段具有不同的属性,则只需要使用。
这样你就可以简化你的代码
QTableView, QTableView QHeaderView,
QTableView QHeaderView::section, QTableView QTableCornerButton:section
{
background-color:rgb(48, 48, 72);
color:white;
}而且只有在需要的时候
QTableView QVerticalHeaderView::section:checked
{
background-color:rgb(255, 0, 0);
color:white;
}https://stackoverflow.com/questions/34265653
复制相似问题