2 回答

TA貢獻1785條經驗 獲得超8個贊
void QGridLayout::addLayout ( QLayout * layout, int row, int column, int rowSpan, int columnSpan, Qt::Alignment alignment = 0 )
addWidget這個函數有四個int型的參數,row是所在行,column是所在列,rowSpan是行跨度,你想跨兩行這個地方設置2,columnSpan這個是列跨度。

TA貢獻1966條經驗 獲得超4個贊
用這個函數添加控件
void QGridLayout::addWidget ( QWidget * widget, int fromRow, int fromColumn, int rowSpan, int columnSpan, Qt::Alignment alignment = 0 )
This is an overloaded function.
This version adds the given widget to the cell grid, spanning multiple rows/columns. The cell will start at fromRow, fromColumn spanning rowSpan rows and columnSpan columns. The widget will have the given alignment.
If rowSpan and/or columnSpan is -1, then the widget will extend to the bottom and/or right edge, respectively.
添加回答
舉報