Chr*_*ung 1 python pyqt stylesheet pyqt4
我用它来设置我的QTableWidget. 表中的所有内容都受到影响,除了horizontalheaderlabels和the row numbers。
Table.setStyleSheet("Background-color:rgb(100,100,100);border-radius:15px;")
Run Code Online (Sandbox Code Playgroud)
所以我试过这个
Table.horizontalHeader().setStyleSheet("Background-color:rgb(190,1,1);border-radius:14px;"
Run Code Online (Sandbox Code Playgroud)
但这似乎没有任何影响。
如何设置的样式表horizontalheaderlabel和the row numbers?
您应该检查Qt Sylesheet 参考
你必须做类似的事情
stylesheet = "::section{Background-color:rgb(190,1,1);border-radius:14px;}"
Table.horizontalHeader().setStyleSheet(stylesheet)
Run Code Online (Sandbox Code Playgroud)
也就是说,如果您想要不同的水平和垂直标题。否则,这应该可以完成工作
stylesheet = "QHeaderView::section{Background-color:rgb(190,1,1);
border-radius:14px;}"
Table.setStyleSheet(stylesheet)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11062 次 |
| 最近记录: |