BoxLayout rookie question



  • Hi!
    Here's my situation:
    I got three Layouts:
    1.QHBoxLayout(parent) aka mainLayout
    2.QVBoxLayout(child) aka vLayout1
    3.QVBoxLayout(child) aka vLayout2

    mainLayout->addLayout(vLayout1);
    mainLayout->addLayout(vLayout2);

    My question is:
    1.How to divide the layouts within the mainLayout equally (If I got 3 layouts in the mainLayout,each of which contains 1/3 place of the mainLayout).

    2.How to add a separator(a vertical,visible line,just like the separator in QMenu) between the two vLayouts (No QFrame please);

    thanks!



  • The answer for both questions is QSplitter use setStretchFactor with the same value to make the layouts take equal space then you can set the handle stylesheet to make it show just a border



  • @VRonin Thanks


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.