![](/img/trans.png)
[英]Performance issue with QHeaderView::ResizeToContents for vertical header in QTableView
[英]Centering the text of a vertical header in a QTableView?
有了这些标志:
Qt::AlignLeft 0x0001 Aligns with the left edge.
Qt::AlignRight 0x0002 Aligns with the right edge.
Qt::AlignHCenter 0x0004 Centers horizontally in the available space.
Qt::AlignJustify 0x0008 Justifies the text in the available space.
仅使用样式表的另一种方法是:
setStyleSheet("QHeaderView { qproperty-defaultAlignment: AlignHCenter; }");
请参阅Qt文档中的设置QObject属性一节。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.