I'm implementing a widget which displays several images in a table. This widget is in a QScrollArea (so it could provide scrollbars when needed), and finally this QScrollArea is in another widget (the window).
I expect that the initial size of the window would be big enough so all the images could be seen without scrollbars. But that doesn't happen, the window is quite small.
I tried with setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding) (for both the QScrollArea and the window) but it doesn't make any difference. I also tried with adjustSize() and updateGeometry() but there's no change.
This is what I got:
But I would expect something like this:
I attach a small sample code which demonstrates the problem.
Is there any way to fix it?
Bookmarks