PDA

View Full Version : [SOLVED] Re: QSplitter Sizes



ToddAtWSU
1st September 2015, 17:16
I am using Qt 4.8.5 and have a question with QSplitter. I currently have a QGroupBox containing some items on the left side of a QSplitter, and on the right side are two group boxes stacked vertically with a QSplitter in between them. The default behavior for the QSplitter is to distribute the widgets on each side in a 50/50 split. However, I would like the left side to get about 25% of the space and the right side to get the rest. I have messed with changing the SizePolicy of the QSplitters and other widgets but see no change in behavior. The only thing I can do is set MaximumSize for the left side, but this ultimately defeats the purpose of using the QSplitter. Any ideas on how to get the initial sizings?

Added after 14 minutes:

Nevermind, just found looking deeper into the documentation, QSplitter does have a setStretchFactor function that can handle this for me. I am surprised this is not editable in Designer like Layouts are.