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.
添加回答
举报
