PyQt5 QScrollArea widget with dynamically created GroupBoxes
问题 I'm trying to make a toolbox widget that will do various different things. But I'm having trouble with the layout management regarding the QScrollArea. Following the stripped version of the code I have: from PyQt5 import QtWidgets import sys class MyScrollWidget(QtWidgets.QWidget): def __init__(self): super(MyScrollWidget, self).__init__() scrollArea = QtWidgets.QScrollArea(self) top_widget = QtWidgets.QWidget() top_layout = QtWidgets.QVBoxLayout() for i in range(10): group_box = QtWidgets