I am trying to set Splliter to 1/3 of the frame but does not work:

ui->splitter->resize(r_frame.width()*0.20); //ошибка ui->splitter->setOrientation(f_frame*0.20); //ошибка 

When I run the program, I get this picture: enter image description here

And I would like to get this: enter image description here

    1 answer 1

    You need a function

     void QSplitter::setSizes(const QList<int> &list) 

    According to the documentation:

    The sets given in the list are given in the list. For each splitter, from left to right. If you’re a splitter, it’s a vertical one.

    An example of use in my program:

     ui->splitter->setSizes(QList <int> () << 250 << 350); 
    • thanks, it worked: 3 - timob256