tgreaves
19th January 2009, 21:55
This resizes perfectly ------
QGridLayout *layout = new QGridLayout(this);
layout->setSpacing(6);
layout->setMargin(11);
QPlainTextEdit* mybox = new QPlainTextEdit(this);
layout->addWidget(mybox, 0, 0, 1, 2);
setLayout(layout);
This doesnt resize at all ------
QWidget* widget = new QWidget(this)
QGridLayout *layout = new QGridLayout(widget);
layout->setSpacing(6);
layout->setMargin(11);
QPlainTextEdit* mybox = new QPlainTextEdit(this);
layout->addWidget(mybox, 0, 0, 1, 2);
setLayout(layout);
The only difference is with the 2nd example, im creating a widget* and making the layout a child of that widget which is what Qt Designer does.. How can I make this resize work using the 2nd example?
QGridLayout *layout = new QGridLayout(this);
layout->setSpacing(6);
layout->setMargin(11);
QPlainTextEdit* mybox = new QPlainTextEdit(this);
layout->addWidget(mybox, 0, 0, 1, 2);
setLayout(layout);
This doesnt resize at all ------
QWidget* widget = new QWidget(this)
QGridLayout *layout = new QGridLayout(widget);
layout->setSpacing(6);
layout->setMargin(11);
QPlainTextEdit* mybox = new QPlainTextEdit(this);
layout->addWidget(mybox, 0, 0, 1, 2);
setLayout(layout);
The only difference is with the 2nd example, im creating a widget* and making the layout a child of that widget which is what Qt Designer does.. How can I make this resize work using the 2nd example?