If you want to add a submenu in the middle of the menu bar, this is not trivial. There is no direct API for this, but you can probably disable this byt by controlling the internal actions of QWidget (QMenu :: addMenu just calls QWidget::addAction(menu->menuAction()) .
In theory, you can manipulate QMenuBar :: actions (), but I never did that.
When I had to deal with this problem, I just restored the menu from another data set (look at your favorite search engine for qmdilib and you will see my solution).
source share