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.
当我调用setIconSize(QSize(16, 16))时QToolBar,它会从四面八方留下边距,主要是底部。setContextMargins(0, 0, 0, 0)没有帮助。我拥有的其他工具栏都是以主窗口的形式设置的,看起来不错,但是这个应该在 中QDockWidget,所以我需要以编程方式进行。
setIconSize(QSize(16, 16))
QToolBar
setContextMargins(0, 0, 0, 0)
QDockWidget
对比图片:
当我将工具栏的高度强制为 16 时,图标会裁剪。如何让其他工具栏的大小和填充完全一样?
要禁用边距:
layoutThatContainsToolBar->setSpacing(0);