This resizes perfectly ------
layout->setSpacing(6);
layout->setMargin(11);
QPlainTextEdit* mybox = new QPlainTextEdit(this);
layout->addWidget(mybox, 0, 0, 1, 2);
setLayout(layout);
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);
To copy to clipboard, switch view to plain text mode
This doesnt resize at all ------
layout->setSpacing(6);
layout->setMargin(11);
QPlainTextEdit* mybox = new QPlainTextEdit(this);
layout->addWidget(mybox, 0, 0, 1, 2);
setLayout(layout);
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);
To copy to clipboard, switch view to plain text mode
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?
Bookmarks