Grid Extension Management
I found that you can easily control which columns / rows expand and which columns / rows remain fixed in width using QGridLayout::setColumnStretch() and QGridLayout::setRowStretch() . You will need to provide weights for specific columns (0 without stretch marks).
For example, if you want column 0 to occupy no room and column 1 to take the rest of the window room, do the following:
QGridLayout* layout ; // Set up the layout layout->setColumnStretch( 0, 0 ) ; // Give column 0 no stretch ability layout->setColumnStretch( 1, 1 ) ; // Give column 1 stretch ability of ratio 1
Controlling grid extension with Qt Designer
You can do what I described above if you use the constructor. Just find the widget properties layoutRowStretch and layoutColumnStretch. It will contain a list of integers, separated by commas.
source share