英文:
why is there a white block on my QTableWidget
问题
我试图为我的应用程序添加深色模式,因为我找不到有关如何样式化 QTableWidgets 的任何信息,所以我尝试根据以前的知识来做,但似乎顶部区域无论我如何更改都保持不变,我该如何修复这个问题?
这是我的 QSS 代码:
QTableWidget {
background-color: rgba(29, 29, 29, 250);
color: rgba(193, 193, 193, 250);
gridline-color: rgba(0, 0, 0, 0);
}
QTableWidget::item {
padding: 4px;
}
QTableWidget::item:selected {
background-color: rgba(50, 50, 50, 250);
}
QTableWidget::item:focus {
background-color: rgba(70, 70, 70, 250);
outline: none;
}
QHeaderView::section {
background-color: rgba(50, 50, 50, 250);
color: rgba(193, 193, 193, 250);
padding: 4px;
border: none;
}
QHeaderView {
background-color: rgba(50, 50, 50, 250);
color: rgba(193, 193, 193, 250);
padding: 4px;
border: none;
}
QHeaderView::section:checked {
background-color: rgba(70, 70, 70, 250);
}
英文:
I am trying to add dark mode to my app, since I couldn't find anything on styling QTableWidgets I tried to do so from previous knowlage, but it seems that the top area stays the same no matter what do I change, how do I fix this?
Here is my QSS:
`QTableWidget {
background-color: rgba(29, 29, 29, 250);
color: rgba(193, 193, 193, 250);
gridline-color: rgba(0, 0, 0, 0);
}
QTableWidget::item {
padding: 4px;
}
QTableWidget::item:selected {
background-color: rgba(50, 50, 50, 250);
}
QTableWidget::item:focus {
background-color: rgba(70, 70, 70, 250);
outline: none;
}
QHeaderView::section {
background-color: rgba(50, 50, 50, 250);
color: rgba(193, 193, 193, 250);
padding: 4px;
border: none;
}
QHeaderView {
background-color: rgba(50, 50, 50, 250);
color: rgba(193, 193, 193, 250);
padding: 4px;
border: none;
}
QHeaderView::section:checked {
background-color: rgba(70, 70, 70, 250);
}
答案1
得分: 0
缺失的部分在这里有记录1(我说的是QTableCornerButton
)。
不确定你想要什么颜色,但以下内容应该接近你想要添加的内容:
QTableView QTableCornerButton::section {
background: rgba(50, 50, 50, 250);
}
英文:
The missing bit is documented here (I am talking about QTableCornerButton
).
Not sure what color you want but this below should be close to what you want to add:
QTableView QTableCornerButton::section {
background: rgba(50, 50, 50, 250);
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论