I want to initialize the splitter handle position like the following instead of in the middle. I cannot set it in the property.
How to solve this?
Thank you for your help.
Select the widgets that you want to be in a splitter (By holding CTL and clicking on them) Right click on a selected widget and from Layout menu select Lay Out Horizontally in Splitter or Lay Out Vertically in Splitter. Now apply a grid layout to the dialog and everything should be OK.
A splitter lets the user control the size of child widgets by dragging the boundary between them. Any number of widgets may be controlled by a single splitter. The typical use of a QSplitter is to create several widgets and add them using insertWidget() or addWidget().
You can use QSplitter::setSizes
in this why to reposition the handle:
ui->splitter->setSizes(QList<int>() << 100 << 200);
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