【发布时间】:2014-03-28 04:22:30
【问题描述】:
我尝试使用 qt 样式表来定位特定列。
在 HTML CSS 中你可以做这样的事情
table.players td:nth-child(N) { /* ... */ }
查看文档,我找不到针对特定 qTableView 列的方法
http://qt-project.org/doc/qt-4.8/stylesheet.html
http://qt-project.org/doc/qt-4.8/stylesheet-reference.html
http://qt-project.org/doc/qt-4.8/stylesheet-syntax.html
我认为在这个例子中我可以用数字替换部分来定位特定的列,但我认为我不明白它在做什么
http://qt-project.org/doc/qt-4.8/stylesheet-examples.html#customizing-qtableview
QTableView QTableCornerButton::section {
background: red;
border: 2px outset red;
}
如果 qt 样式表无法做到这一点,那么重写paint方法并重用Qt代码的最佳方法是什么?
【问题讨论】:
标签: qt pyqt qtableview qtstylesheets