Solved break content inside a layout
-
I can't exactly describe it in words, here it is what I mean,
Suppose a window with 3 widgets| (widget1) (widget2) (widget3) |
(the pipes represent the walls of the window)
when I shrink the window with the mouse, i want these widgets to go below the previous ones, like this
| (widget1) (widget2) | | (widget3) |
or even this:
| (widget1) | | (widget2) | | (widget3) |
Kind of like text in a box in html with
word-wrap: break content
applied to itFor now, the window doesn't shrink below the minimum size of the widgets. I'm using QPushButtons as widgets here.
Is this possible natively? Do I have to handle the resize event and rearrange them myself? Feel free to discuss.
-
@candh
"Flow Layout".
See this old example: https://doc.qt.io/archives/4.6/layouts-flowlayout.html (brought up to date in PyQt5 translation at https://stackoverflow.com/a/41643802/489865)
And this stackoverflow: https://stackoverflow.com/questions/9660080/how-does-one-fill-a-qgridlayout-from-top-left-to-right -
thank you!