How to use QScrollArea to make scrollbars appear
问题 I am trying to create a scroll area with a vertical layout using pyqt5, and I am putting inside some labels. I know that even if it is a vertical layout it is supposed to scroll horizontally if the text does not fit. But no matter what I try it does not let me scroll. This is the code I am using: class window(QMainWindow): def __init__(self): super(window, self).__init__() self.setGeometry(300, 300, 803, 520) self.init_ui() def init_ui(self): self.teacher_box = QScrollArea(self) self.teacher