qt默认布局控件都会自带2-3像素的间隙,查过很多方法都是说qt的框架原因,不好去除。现在找到方法了记录下 QVBoxLayout QHBoxLayout setMargin(0); QWidget QMainWindow 等其他控件 setContentsMargins(0,0,0,0);