当前位置:编程学习 > wap >>

addWidget中参数的设定

Glayout->addWidget(NameLabel,100,100,1,1);
上面这句中后面的四个参数表示什么意思?应该怎么设定呢?这些整型数值的取值范围应该是多少啊?希望哪位能给出比较详细的解答! --------------------编程问答-------------------- QGridLayout::addWidget ( QWidget * widget, int row, int column, Qt::Alignment alignment = 0 )

row:行位置
column:列位置
alignment;对齐方式 --------------------编程问答-------------------- 共有五个参数啊,后面两个都是对齐方式吗? --------------------编程问答-------------------- 起始行,起始列,占用行,占用列 --------------------编程问答-------------------- 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.

控件名,行,列,占用行数,占用列数,对齐方式 --------------------编程问答-------------------- 十分感谢
补充:移动开发 ,  Qt
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,