I have a grid layout shown below containing 3 QLabel objects that are used to display 3 seperate video streams. Some streams can be toggled off and I want the display to automatically resize within the layout to the maximum size.
When using two adjacent QLabels (red & blue alone) I was able to do this by using setVisible(false) on one label, and the other label would resize to fill the layout area. But adding a third label object underneath in the following layout has broken this although i'm not sure why.
Here is 2 'streams' activated just using two adjacent qlabels in a gridlayout (Just testing with webcam, 2nd display has no video yet)
and then after calling label2->setVisible(false)
This is the result I want when using 3 labels. When I try this and set label 2 and 3's visibility off, this is what I get:
The gridlayout containing the qlabels is using a setFixedSize constraint, and each qlabel is using a preferred sizing policy for horizontal and vertical. You can see that the vertical resizing works as it should but not the horizontal. How can I adjust the label to correctly resize horizontally?
the full style sheet for the ui can be seen here: http://pastebin.com/vJUkMGT8