LogicStuff
LogicStuff

Reputation: 19607

QToolBar - disable margins

When I call setIconSize(QSize(16, 16)) on QToolBar, it leaves margins from all sides, mainly bottom. setContextMargins(0, 0, 0, 0) does not help. Other toolbars I have are set up in the form of main window and look fine, but this one is supposed to be in QDockWidget, so I need to do it programmatically.

Image with comparison:

When I force the height of the toolbar to 16, the icons crop.
How to the other toolbar exactly the same size and padding?

Upvotes: 3

Views: 991

Answers (1)

Yueala Provenance
Yueala Provenance

Reputation: 159

To disable margins:

layoutThatContainsToolBar->setSpacing(0);

Upvotes: 7

Related Questions