- To make a widget auto-sizable by itself, it needs to be placed in the layout.
- Call the setLayout(top_most_layout_from_the_designer) at the place where you use the designer's code (the place where you call setupUi())
we re-set the layout using ui's layout.
Now the widgets inside the layout can be auto-resize in the Qt Designer.
Convince yourself that all the GUI work should be taken care of by the Designer, if you are using it. Try not to alter the code generated by the Qt Designer (the ui header file). The generated file will be overwritten next time you make change, and that's inconvenient. Unless you really want to handle the resizing yourself, do not implement the resizeEvent. Your code might break i n the future on different machine with different resolution.