PDA

View Full Version : Flow Layout



zeux
26th September 2011, 12:44
Hi people

I want to create a viewport mechanism, where i have a workspace (widget), and I want to add to it viewports (widget) in a dynamic way. So, the idea is to have different number of widgets in that workspace, and get them organized in a automatic way. For example, if I add just 1viewport, it will be displayed in all available space, if 2 viewports, they get organized side by side, 3 viewports should be displayed two on top (side by side), and the another one on the bottom.

I tried to use flow layout (http://doc.qt.nokia.com/latest/layouts-flowlayout.html), but the problem is that the viewports aren't expanding in available space. Do you know some easy way to do this, or I should implement a solution based in a GridLayout ?

Thanks in advance

wysota
27th September 2011, 00:51
I think you should either implement your own QLayout subclass or use QGridLayout with some manual tweaking.