You shouldn't have to write any code to automatically resize your child widget. (Also, changeEvent()
is not the correct event handler for this purpose anyway.)
Your problem is likely with the layout that you've created with Qt Designer. You probably dragged a vertical layout from the sidebar into your form widget, which is actually doesn't create a top-level layout. It's very easy to make this mistake.
Instead, do one of the following to create top-level layouts in Qt Designer:
Right-click on your top-level (form) widget in the Object Inspector, and choose one of the layouts from the "Lay Out" menu.
Select your top-level widget and click on one of the layout icons in the toolbar:
If you set up your layout(s) correctly, you don't need to add any code. Your layout will update automatically if you preview your form in Qt Designer.