layout stretch error?
-
wrote on 3 Jun 2025, 05:04 last edited by
-
wrote on 3 Jun 2025, 12:25 last edited by
@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?
-
@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?
wrote 26 days ago last edited by@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. -
@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.wrote 26 days ago last edited by Pl45m4 6 Aug 2025, 01:05@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
-
2/5