I'm trying to have a 2x2 QGridLayout arranged as follows:
+-----+-----+
|(1) |(2) |
+-----+ |
|(3) | |
+-----+-----+
I want to be able to expand (1) programatically to occupy the whole first row, like as follows:
+-----------+
|(1) |
+-----+-----+
|(3) |(2) |
+-----+-----+
Actually, I want to expand and contract any widget to any direction.
I'm able to do this by just detecting what widget is in the cell I need to expand to. But the problem is that it is a pain to make this happen on any direction and any grid size, because I need to go back to the initial position of the just expanded widget (1), so I don't need to remember positions, except the one I'm expanding/contracting.
So, in the example above, I decided to just expand the widget to occupy the position 0,0 with column span of 2. This will result in overlapping widgets, which is ok for me. The problem is that widget (1) will be underneath (2), I guess because of order of insertion into the grid. Hence the question: how do I control a widget's overlap priority in a QGridLayout?
Thanks!