How to manage QSplitter in Qt Designer

后端 未结 2 1613
谎友^
谎友^ 2020-12-29 01:49

When I press a button, I bring up a dialog where user select things and press \'Ok\' at the end. I want a splitter in this dialog. Left pane will show tree and right will sh

2条回答
  •  清歌不尽
    2020-12-29 02:32

    You can simply create splitter containing items in Qt Designer :

    1. First place your widgets on your dialog or widget in designer (They should not be in a layout)

    2. Select the widgets that you want to be in a splitter (By holding CTL and clicking on them)

    3. Right click on a selected widget and from Layout menu select Lay Out Horizontally in Splitter or Lay Out Vertically in Splitter.

    4. Now apply a grid layout to the dialog and everything should be OK. You would see something like this in Object Inspector View :

    enter image description here

提交回复
热议问题