Position of icons in vertical QToolbar when switching between Qt::ToolButtonIconOnly and Qt::ToolButtonTextBesideIcon

264 Views Asked by At

When switching between Qt::ToolButtonIconOnly and Qt::ToolButtonTextBesideIcon in a vertical QToolBar, there is a slight shift of the icon to the right when expanding the toolbar:

QToolBar

Is it possible to get steady icons, which do not shift to the right like this?

QToolBar

1

There are 1 best solutions below

0
elsamuko On BEST ANSWER

I found a workaround with the stylesheet QToolBar QToolButton { padding-right: 3px; }. To center the icon when the tabbar is closed, I added some spacing to the left of the icon itself.