Let me explain a simplified situation. In Qt Creator, create a QHBoxLayout
containing a QPushButton
and another QHBoxLayout
which cont
This issue is only visible for several certain widgets (e.g QPushButton
, QComboBox
etc) on Mac OS.
Setting Qt::WA_LayoutUsesWidgetRect
attribute on those widgets would solve it:
button->setAttribute(Qt::WA_LayoutUsesWidgetRect);
Reference: QMacStyle: QPushButtons always have space below when in a QLayout
A related issue with the same solution could be found here: Why is QHBoxLayout causing widgets to overlap?