PDA

View Full Version : Size proportions of widgets in QSplitter



Boron
9th October 2009, 17:26
Hello,
I have some problems with the proper resizing of widgets in QSplitter.
As you can see in the small screenshot I attached there is a textEdit in the upper half of the splitter. A button and a second textEdit are in the lower half. These are layouted in a gridLayout.
What I am trying to achieve is to make the upper smaller than the lower part of the splitter. Let's say: the upper textEdit about 1/3 of the vertical space and the button + second textEdit the rest of 2/3 of the space.

I played around the the sizePolicies of both textEdits but without success. I also tried to give a maxHeight for the upper textEdit but this only produces some completely unused space in the dialog.

Any idea? No matter if this can be achieved inside Qt Designer or by manual coding.

Grimlock
9th October 2009, 17:49
void QSplitter::setSizes ( const QList<int> & list )

Sets the child widgets respective sizes to the values given in the list.

Boron
9th October 2009, 18:25
Thanks for the inspiration. I used setStretchFactor(...) now which can handle "proportions" and not sizes directly.