【发布时间】:2016-06-05 06:59:49
【问题描述】:
但我在 QTableView 中设置了该样式表:
QTableView {
gridline-color: black;
background-color: transparent;
}
QHeaderView {background-color: transparent;
}
QHeaderView::section{
border-style: none;
border-bottom: 1px solid rgb(0,0,0);
background-color: transparent;
margin-bottom:5px;
margin-top:5px;
}
QTableView QTableCornerButton::section {
bottom-style:none;
border-bottom: 1px solid rgb(0,0,0);
}
我可以处理未来的尺寸问题,但这里有两个主要问题:
1.边框之间的列文本没有任何空格,我做了margin-top:5px;和margin-bottom:5px;,但它改变了所有QHeaderView不仅QHeaderView的文本。 (解决方案是使用填充而不是边距)
2.每一行都有一个右、左甚至上边框。我不想那样。
我试过了:
QTableView QTableCornerButton::section {
border-style:none;
border-bottom: 1px solid rgb(0,0,0);
}
很遗憾,QTableCornerButton:section 出现问题,它不起作用...
感谢您的帮助
【问题讨论】:
-
请注意:您无法获得只有水平网格线而没有垂直网格线的表格。必须有完整的网格或没有网格。要获得第一张图片上的内容,您必须使用自定义绘画实现委托。
标签: c++ css qt qtstylesheets