Suppose I have two Qt widgets in a vertical layout inside a parent widget.
Is there someway to add a control "border" between them such that when you click and drag the border area in between the two widegets you can change the relative area of the parent they take?
That is if you drag it up then the bottom widget gets resized bigger and the top widget gets resized smaller.
All you need is QSplitter.
If you prefer creating widgets in code, look the docs from the link above.
If you like visual layout in QtDesigner/QtCreator, you may download my recent little project and open in in QtCreator. In mainwindow.ui
you'll find a lot of QSplitters! You can create them using context menu: select two widgets -> right click -> Lay out -> Lay out vertically in a splitter.
In short, replace your vertical layout with a single QSplitter and add your two widgets to it as children.
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