I have the following structure:
QScrollArea
- QWidget (with QHBoxLayout)
- QLabel
- QLabel
- QLabel
...
QLabels are generated automatically with random text.
How do I change the size of the widget automatically to fit labels?
At the moment, I can see the widget only by setting a fixed size.
Use resize()
method on the widget.
resize(sizeHint())