你看这样可不可以,不用QVBoxLayout布局来设置位置。直接用void QWindow::setGeometry(int posx, int posy, int w, int h).
参数一次是对于父的横坐标、综坐标、宽度、高度,这样设置了3个PushButton的位置后,隐藏2,1和3还是会保持原来的位置。
The QSpacerItem class provides blank space in a layout.
Normally, you don't need to use this class directly. Qt's built-in layout managers provide the following functions for manipulating empty space in layouts:
然后QVBoxLayout->addSpacerItem()
新手为什么不用qtdesigner去设计ui