My project consists of a Main Window displaying a graphical custom widget. I'd like to fill main form with widget frame, and bind together their resizing. Until now I found:
1. Adding in MainWindow constructor the code
ui->MyCustomWidget->setGeometry(0,0,this->width(),this->height());
QBoxLayout *layout = new QBoxLayout(QBoxLayout::LeftToRight,this);
layout->addWidget(ui->MyCustomWidget);
this->setLayout(layout);
So doing child widget fills the parent window but do not resize according to parent resizing (do not change at all).
2. From designer, right clicking on main form and selecting layout/layout in a grid command. So doing, child resizing works fine but I get an unwanted void frame around the widget.
3. Subclassing MainWindow::resizeEvent. In such a case widget frame fills completely parent window and resizing works fine.
Do you know a way to achieve 1 or 2 issues?
Bookmarks