I've designed the following form using Qt Designer. When the main window is resized, I want to keep the left side layout (the QHBoxLayout) at a fixed size and expand only the right side QLineEdit widget.
By adding a vertical spacer to left QHBoxLayout, I was able to make its height fixed but I'm unable to achieve the same for the width.
When the width of the main window increases, the width of both QHBoxLayout and QLineEdit increases.
How can I make the left side layout to be of fixed size?


I'm able to achieve the required behavior by setting the
layoutStretchto(0, 1)My main horizontal layout contains two widgets, a vertical layout and a
QLineEidt. By setting the layout's stretch factor to(0, 1), we specify that the left vertical layout should take a minimum space and the rightQLineEditshould take all the available space.As per Qt documentation:
https://doc.qt.io/qt-6/layout.html#stretch-factors