为什么我的QTableWidget上有一个白色块?

huangapple go评论63阅读模式
英文:

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);
}

为什么我的QTableWidget上有一个白色块?

英文:

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?

为什么我的QTableWidget上有一个白色块?

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);
 }

huangapple
  • 本文由 发表于 2023年6月5日 20:03:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/76406231.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定