layout stretch error?
-
@cuijg said in layout stretch error?:
if stretch setting 1,0,0, it's right;but if setting 0,0,1 it‘s error;
What error?
-
@Pl45m4
There are three layouts in total. I want the rightmost one to fill the remaining space, so I set 0,0,1. However, at this time, the leftmost layout stretches and becomes wider. The horizontal sizePolicy of all controls is set to preferred.@cuijg said in layout stretch error?:
However, at this time, the leftmost layout stretches and becomes wider. The horizontal sizePolicy of all controls is set to preferred
Because it can take its preferred size... the left layout has other widgets inside, so it respects the size of its content.
Also 0 means default/ignored stretch... if you want 33%, 33% 33% for all three layouts, set the stretch to1, 1, 1,
While e.g.2, 1, 1
means 1/2, 1/4, 1/4 of the available space.If you want the right layout to only fill what's remaining, try
1, 1, 0
-
@cuijg said in layout stretch error?:
However, at this time, the leftmost layout stretches and becomes wider. The horizontal sizePolicy of all controls is set to preferred
Because it can take its preferred size... the left layout has other widgets inside, so it respects the size of its content.
Also 0 means default/ignored stretch... if you want 33%, 33% 33% for all three layouts, set the stretch to1, 1, 1,
While e.g.2, 1, 1
means 1/2, 1/4, 1/4 of the available space.If you want the right layout to only fill what's remaining, try
1, 1, 0
-