1
votes

Sorry for bad english. I have 2 horizontal layouts with buttons and text edits and a grid layout with buttons. Form has vertical layout. I need buttons with text edits resize vertically same as buttons in grid layout. Now I can make only one of the parts of form resize: when buttons in horizontal layouts have size policy expanding, grid layout does not resize, otherwise only grid layout resizes.

Screenshots

enter image description here

enter image description here

enter image description here

mainwindow.ui file

1
Did you consider to layout everything with only one QGridLayout? Don't know how to do this with Qt Designer but in C++ it is easy to attach QWidgets to multiple rows and/or columns.Scheff's Cat
I don't have time to go through a thousand line of UI file but... from the images it looks as if you need to assign all of the vertical stretch to the grid layout.G.M.
Thanks, adding all to grid layout helped imgur.com/a/lY0UuMaxim Falaleev
This is indeed a possibility, but depending on what you want, my answer gives you more flexibility.m7913d

1 Answers

1
votes

The problem resides in the stretch distribution of the verticalLayout (QVBoxLayout) of the centralWidget. At the moment space is rather equally distributed (taking minimum size into account) over the two vertical layouts and the grid layout. What you probably want is a distribution of 1 (vertical layouts) to 7 (grid layout), because there are 7 rows in the grid layout. So, you should change the centralWidget > Layout > layoutStretch factor to 1,1,0,7. (0 is for the vertical line)

enter image description here