Preventing shrinking of objects in a layout when making a program using PyQt5

54 Views Asked by At

I tried to build a simple program using PyQt5 but got a problem.
There is a QScrolArea, to which a QVBoxLayout is set. And several QGroupBox objects are set inside the QVBoxLayout.
I briefly describe the structure at the below simple code and picture(a). But the problem occurs when the main window size is reduced. When the main window size is reduced, every object inside QScrollArea(or QVBoxLayout) shrinks and overlaps to each other just like picture(b). This makes my program ugly. I want to every QGroupBox object be shown like picture(c). Do I miss something? Please share your knowledge and idea how to avoid this objects shrinking and overapping problem.

QScrollArea = QVBoxLayout() 
QScrollArea.addWidget(QGroupBox1)
QScrollArea.addWidget(QGroupBox2)
QScrollArea.addWidget(QGroupBox3)

enter image description here

enter image description here --> enter image description here

0

There are 0 best solutions below