C++/Qt/QHBoxLayout — различия между версиями
Admin (обсуждение | вклад) м (1 версия: Импорт контента...) |
Admin (обсуждение | вклад) м (1 версия: Импорт контента...) |
(нет различий)
|
Текущая версия на 10:25, 25 мая 2010
Using for loop to add widget to Layout
#include <QtGui>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QWidgetw;
QHBoxLayout lay(&w);
QTextEdit *txtEdit = 0;
for (intstretch = 1;stretch <= 5; stretch++) {
txtEdit = new QTextEdit(&w);
lay.addWidget(txtEdit, stretch);
}
w.show();
return a.exec();
}