MainWindow not resizing when adding widgets
Unsolved
General and Desktop
-
I have a QMainWindow that has a grid. The grid is not filled yet at (0, 1) and (0, 2). When a button click is performed, some images will be constructed inside in a QGraphicsView/Scene and they are added to a QHBoxLayout. This layout is then added to the grid at (0,1) and spans 2 columns and 1 row. However, my main window stays the size it currently is. But I want it to adapt to the size of the loaded images. How can I achieve this?
P.S. I'm doing this in PyQt
-
@Athylus
try resizing it to it's sizeHint() after adding the widgets. -
Hi,
Can you show how you are setting up your widgets ?