Please give me some idea on resizing the child window. I have parent widget, when resizing this parent widget, I want all my other child widgets should also resize accordingly.

I have tried with QFormLayout, with formlayout, the widget’s size is changing, e.g a pushbutton is coming horizontally as long as the parent widget, although I am specifying a size for 100,25 width and height.

Please give me some suggestion. Check this snippet.

Qt Code:
  1. MainWindow::MainWindow(QWidget *parent):QMainWindow(parent)
  2. {
  3. setGeometry(0,0,600,400);
  4. QPushButton *button = new QPushButton(“Add chart”, this);
  5. button->setGeometry(5,5,100,25);
  6. button->show();
  7.  
  8. QTextEdit *edit = new QTextEdit(this);
  9. edit->setGeometry(5, 35, width()-10, height()-40);
  10. edit->show();
  11. }
To copy to clipboard, switch view to plain text mode 
This 2 controls are set on the widget, now when I resize to the full screen, the textedit size is not changing accordingly, please help what I can do for this. Thanks Sujan