fixed menu bugs introduced in f2bff5f150

Turns out setting a QMenu parent *not* in the constructor leads to very strange
behavior. All parents are now set in the constructor.
This commit is contained in:
itsmattkc
2020-04-19 16:19:08 +10:00
parent f063d4741d
commit 410f3d25dc
6 changed files with 16 additions and 29 deletions
+1 -2
View File
@@ -305,11 +305,10 @@ void NodeView::ShowContextMenu(const QPoint &pos)
Menu m;
Menu* add_menu = NodeFactory::CreateMenu();
Menu* add_menu = NodeFactory::CreateMenu(&m);
add_menu->setTitle(tr("Add"));
connect(add_menu, &Menu::triggered, this, &NodeView::CreateNodeSlot);
m.addMenu(add_menu);
add_menu->setParent(&m);
m.exec(mapToGlobal(pos));
}