c++qtqt-designerqsplitter

Qt Designer add splitter between widget in my QMainWindow


I have a page which looks like this

MainWindow (QMainWindow)
 +---centralWidget (QWidget)
 | +----my_first_widget (QWidget)
 | +----my_second_widget (Qwindget)

I would like to put a QSplitter between my first and my second widgets but when I select them then in the menu selecting Layout, the option Lay Out Vertically In Splitter remains disabled. What am I missing?


Solution

  • I've finally found a way to do so,

    First we need to select the centralWidget and remove the layout disposition on it.

    Next we select the two widgets and then in the options select layout then Lay Out Vertically/Horizontally In Splitter that is reenabled by setting the centralWidget to no layout.

    And once that all done you can reset the layout of the centralWidget to his original value.