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.
我使用 addAction 方法向 QToolBar 添加了几个项目。有没有办法控制项目内部的间距?我的意思是项目文本(或图标)和项目边框之间的间距
您可以使用样式表。例子:
myToolbar->setStyleSheet("QToolButton { padding-left: 20px; padding-right: 40px; }");
请参阅Qt 样式表参考和自定义 QToolButton