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
+3 -4
View File
@@ -63,9 +63,9 @@ void NodeFactory::Destroy()
library_.clear();
}
Menu *NodeFactory::CreateMenu()
Menu *NodeFactory::CreateMenu(QWidget* parent)
{
Menu* menu = new Menu();
Menu* menu = new Menu(parent);
menu->setToolTipsVisible(true);
for (int i=0;i<library_.size();i++) {
@@ -98,8 +98,7 @@ Menu *NodeFactory::CreateMenu()
// Create menu here if it doesn't exist
if (!found_cat) {
Menu* new_category = new Menu(dir_name);
new_category->setParent(destination);
Menu* new_category = new Menu(dir_name, destination);
destination->InsertAlphabetically(new_category);
destination = new_category;
}