gpt4 book ai didi

c++ - 如何改变QTableWidget垂直表头的背景颜色?

转载 作者:行者123 更新时间:2023-12-03 07:03:22 31 4
gpt4 key购买 nike

我想更改QTableWidget 的颜色。我几乎得到了我喜欢的结果,但垂直标题中的两个区域仍然是白色的:

enter image description here

在写这篇文章之前,我实际上也设法给左上角上色,但没有给其他区域上色。这是我正在使用的样式表:

QTableCornerButton::section {
background-color: #8b8d8e;
}

QHeaderView::section {
color: white;
background-color: #747678;
gridline-color: #747678;
}

最佳答案

终于自己找到了答案:

/*The top-left area is actually a button:*/
QTableCornerButton::section {
background-color: #8b8d8e;
}
/*The lower part of the vertical header:*/
QHeaderView {
background-color: #8b8d8e;
}

我发布的原始 css (QHeaderView::section) 仅引用标题条目,而不是标题本身。

关于c++ - 如何改变QTableWidget垂直表头的背景颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64702850/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com