Very dynamic window layout
Hi! I'm currently using PySide, but If somebody could help me even with C++ code it will be easy movable to Pyside.
I'm creating an application and one of the main requirements is to create very dynamic layout - the application concist of one empty window, which you can divide however you want, creating "docks" and in each dock there will be displayed a plugin (lets say plugin is some logic and view). It is important that user could move the windows to other docks or create next docks if he wants to.
I started with simple window with 4 QdockWidgets, but when dragging these widgets I'm not able to place for example 3 of them next to each other (this is of course true, because the dock widgets could be placed on the left or right of "center widget" - but in this application there is no center widget).
Basically - I'm trying to create application, that will have only DockWidgets, which user can arrange like he wants (for example one big on top and 10 next to each other on the bottom).
How could be this done in qt?
That's an interesting case.
I don't know any widget allowing you to do what you want. So one solution would be to have a QGridLayout over your whole parent widget, and play with it and "drag and drop":http://doc.qt.digia.com/stable/dnd.html functionnality.
The parent grid layout will make sure your widgets don't overlap, and layout properly.
But using grid layout I'm able to place windows only in "grid boxes", so it would be impossible to for example arrange items like (three on top of each other on the left) | (one big o the right).
Items placed in QGridLayout can have a colspan and rowspan set to >1, so that a single item can occupy a couple of "grid boxes" at a time. So yes, it would be possible.