Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
QToolBox我在我的 ui 文件中添加了一个。
QToolBox
但是没有任何选项可以更改对齐方式!
我想QToolBox从左到右从右到左更改标题文本对齐方式。
我该怎么做?
不幸的是,没有任何神奇的方法可以改变对齐方式,但您可以使用样式表。例如:
ui->toolBox->setStyleSheet(" QToolBox::tab {padding-left: 10px;} ");
此代码允许您将标题文本左右移动(如果您重置此选项),但它不是对齐。反正总比没有好。