c++qtsplitterqsplitter

How to initialize the splitter handle position?


I want to initialize the splitter handle position like the following instead of in the middle. I cannot set it in the property.

enter image description here

How to solve this?


Solution

  • You can use QSplitter::setSizes in this why to reposition the handle:

    ui->splitter->setSizes(QList<int>() << 100 << 200);