Problem using layouts ion QT Designer
-
I'm trying to design a QWidget form using layouts and I have the following issue:
my need is to nest a Grid Layout and a Vertical Layout into a Horizontal layout. I put the Horizontal Layout in the form but when I insert the Grid layout (into Horizontal layout) it takes the whole size of Horizontal layout and I can't resize the Grid layout only.
I checked the documentation but I didn't find a solution for this behaviour.Thanks for any suggestion
-
@Achab61 said in Problem using layouts ion QT Designer:
it takes the whole size of Horizontal layout and I can't resize the Grid layout only
Of course it does if there is noting else in the horizontal layout.
What exactly do you want to achieve? How big should the grid layout be? -
My need is to have a Horizontal layout containing a Grid layout and a Vertical layout. The Grid layout should take more than half size of the Horizontal and the rest should be for the Vertical. I will then put label and text box in the Grid and button and check box in the Vertical.
I first placed the Horizontal layout in the form, then I drag the Grid but, as said, it takes the whole size and it can't be resized. -
@Achab61 said in Problem using layouts ion QT Designer:
it takes the whole size and it can't be resized
No need to resize it. Add the vertical layout to the horizontal (next to grid layout). It can be somewhat tricky, but works. Then select the horizontal layout and set the layoutStretch property to your needs, so the horizontal layout reserves different amount of space for grid and vertical layout.