#include <QtGui> int main(int argc, char *argv[]){ QApplication a(argc, argv); QSplitter s; QTextEdit *txtEdit = 0; for (int stretch = 1; stretch <= 5; stretch++) { txtEdit = new QTextEdit(&s); s.addWidget(txtEdit); s.setStretchFactor(s.indexOf(txtEdit), stretch); } s.show(); return a.exec(); }