I'm having trouble with a scroll-area which disappears when we try to set the maximum/minimum size of a widget inside it. Is this normal behaviour?
For information, this is how my screen is built:
<Splitter>
<ScrollArea>
<LayoutOfScroll>
<Widget>
<Layout>...
and there are a lot of other widgets in the Layout, which are the ones that I am trying to set maximum size for. But when I do set maximum/minimum size on them, they prefer to stack themselves...
I should specify that I already set the widgetResizable
property to True
and that if I set it to False
, the scroll-area is there, but then I can't resize my window because the widgets keep the same size...
How can I set a maximum/minimum size on my child widgets and keep the scroll area.
PS: here is what I've read in the docs of QScrollArea
, but I don't understand it... It seems to correspond to my case:
If a scroll area is used to display the contents of a widget that contains child widgets arranged in a layout, it is important to realize that the size policy of the layout will also determine the size of the widget. This is especially useful to know if you intend to dynamically change the contents of the layout. In such cases, setting the layout's size constraint property to one which provides constraints on the minimum and/or maximum size of the layout (e.g., QLayout::SetMinAndMaxSize) will cause the size of the scroll area to be updated whenever the contents of the layout changes.