This thing seems really basic to me, though I could not find any information on how to implement it.
I have some sort of QGridLayout
that contains equally-sized widgets. I would like to update its row/column count based on the layout size.
For instance, on a relatively wide screen, it would look like this:
But if the screen is not wide enough to fit all the items it would grow vertically like this:
The QGridLayout
doesn't support this automatically. You can either:
Use QGridLayout
with a number of columns set according to screen width divided by the widget width, and the number of rows sufficient to fit the widgets, or
Use the flow layout example and modify to your needs.