In QtCreator I created a QSplitter which separates vertically a QTreeWidget from a vertical layout with many things on the right.
I would like that this second column by default takes the minimum space it needs to maximise the first one.
I tried setting sizes and vertical policy of the splitter as expanding but surely I'm not doing it right. How can I set this exactly?
You can set this in code with QSplitter::setStretchFactor(int index, int stretch)
.
You would set the first column to have a stretch of 1 and the second 0.
splitter->setStretchFactor(0, 1);
splitter->setStretchFactor(1, 0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With