标签: qt toolbar qmainwindow
如何在QAction图标之前添加空格。就像这张图片一样。我为此mainToolBar设置样式表spacing:10px;但是我需要在图标1之前添加标签空间。< / p>
QAction
mainToolBar
spacing:10px;
答案 0 :(得分:1)
Make placeholder widget and use QToolBar::insertWidget for insert that widget. UPD: Example of code
QWidget* placeholder = new QWidget( this ); ui->toolBar->insertWidget( new QAction( this ), placeholder ); placeholder->setWidth(100);