1
votes

I have a vertical QSplitter with two widgets inside whose layouts contains more widgets. How can I set the initial height of the second widget to its minimum possible height (wrap to its content)?

Thanks in advance,

1
Possible, set vertical size policy of widget to Maximum. - Dmitry Sazonov

1 Answers

4
votes

You can use QSplitter::setSizes to set widgets' sizes. You can obtain total available space using QSplitter::size. You can obtain minimal width of the second widget using QWidget::sizeHint. It will help you to calculate values that should be passed to setSizes.