如何在 QMainToolBar 中的 QAction 按钮之前添加制表符 space

How to add tab space before QAction buttons in QMainToolBar

如何在 QAction 之前添加 space icons.Like this image.I set style-sheet for mainToolBar like this spacing:10px; 但我需要在图标 1 之前添加选项卡 space。

制作占位符小部件并使用 QToolBar::insertWidget 插入该小部件。 UPD:代码示例

QWidget* placeholder = new QWidget( this );
ui->toolBar->insertWidget( new QAction( this ), placeholder );
placeholder->setWidth(100);