没想到是一个bug,而且六年了都没有解决:
https://bugreports.qt.io/browse/QTBUG-14591
http://*.com/questions/3978889/why-is-qhboxlayout-causing-widgets-to-overlap
http://*.com/questions/22519217/items-in-qhboxlayout-layout-overlap
http://doc.qt.io/qt-4.8/qmacnativewidget.html
临时方案是,给layout里的每一个控件都加上:
pushButton->setAttribute(Qt::WA_LayoutUsesWidgetRect);
真是够麻烦的~