How to manage QSplitter in Qt Designer

假装没事ソ 提交于 2019-11-29 05:27:47

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 :

You can still create your controls in a .ui file using Qt Designer (integrated in Qt Creator). Within Qt Designer, add a QWidget object to your dialog. Then, from QDialog derived class you'll write, directly in your constructor, create your QSplitter using the QWidget object as a parent.

This way, you can create all but the splitter object from Qt Designer.

I think it's also possible to create the QSplitter (as you can create a QButton, QCheckBox...) item directly from Qt Designer.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!