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)?
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.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more