相关文章推荐
没人理的骆驼  ·  使用 Tabindex  |  ...·  4 月前    · 
玉树临风的鸵鸟  ·  "Algosensey ...·  1 年前    · 
干练的瀑布  ·  Disk space used by a ...·  1 年前    · 
乐观的毛衣  ·  DSI·  1 年前    · 


没想到是一个bug,而且六年了都没有解决:

https://bugreports.qt.io/browse/QTBUG-14591

http://stackoverflow.com/questions/3978889/why-is-qhboxlayout-causing-widgets-to-overlap

http://stackoverflow.com/questions/22519217/items-in-qhboxlayout-layout-overlap

http://doc.qt.io/qt-4.8/qmacnativewidget.html

临时方案是,给layout里的每一个控件都加上:

pushButton->setAttribute(Qt::WA_LayoutUsesWidgetRect);

真是够麻烦的~