qt - How to control widgets overlap priority in a q[grid]layout? -


I'm trying to organize a 2x2 QGridLayout:

  + - - - + ----- + | (1) | (2) | + ----- + | | (3) | | + ----- + ----- +  

I want to be able to expand the program (1) to capture the entire first line, as follows:

+ ----------- + | (1) | + ----- + ----- + | (3) | (2) | + ----- + ----- +

Actually, I want to expand and contract any widget in any widget.

I am able to find out what room to expand in me, what is in that room. But the problem is that it is a way to do this on any direction and any grid size The pain is because I just have to go back to the initial position of extended widget (1), so I do not have to remember the posts, except that I am doing extension / contract.

Therefore, in the above example, I decided to expand the widget with a 0,0 column duration. The overlapping widget, which is fine for me, is the problem that the widget will be (1) below (2), because I think because of the order of the insert in the grid Question: How do I control the overlap priority of any widget in a QGridLayout Can i do

Thank you!

Perhaps you can do something like this with some experimentation.

alt text

Two shots of one QVBoxLayout two QHBoxLayouts You should be able to dynamically remove and add buttons from one QHBoxLayout to another. You can add spacer to determine or remove whether a button will increase the full width or not.

I know that it's still adding widgets and removing, but this grid layout can be a bit easier. / P>


Comments