View Full Version : QHBoxLayout line wrapping

11th January 2013, 04:59
I am wondering if there is a way to have a QHBoxLayout that will automatically span multiple rows if the content width is less than the parent widget?

For example, if I have 4 small images in a QHBoxLayout that is too wide, but would fit when displayed as 2x2... Or if I made it a bit wider so that 3 could show on the first row and 1 on the second?

Thanks, I've been googling for the past few hours and haven't had any luck.

Santosh Reddy
11th January 2013, 07:00
Are you looking for Flow Layout Example (http://doc.qt.digia.com/qt/layouts-flowlayout.html)

11th January 2013, 14:07
Yes, this looks like what I am trying to accomplish. I am surprised there is no built in flow-like layout in Qt...
Thank you for pointing me toward this!