簡體   English   中英

如何更改 QTableWidget 的垂直標題的背景顏色?

[英]How to change the background color of the QTableWidget's vertical header?

我想更改QTableWidget的顏色。 我幾乎得到了我喜歡的結果,但垂直標題中的兩個區域仍然是白色的:

在此處輸入圖片說明

在寫這篇文章之前,我實際上也設法給左上角上色,但沒有給其他區域上色。 這是我正在使用的樣式表:

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) 僅指標題條目,而不是標題本身。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM