Merge pull request #1441 from maxGimeno/Polyhedron_demo-Fix_menus_with_unity-GF

Polyhedron_demo : Fix the menu bug with Unity
This commit is contained in:
Laurent Rineau 2016-09-13 18:18:30 +02:00 committed by GitHub
commit c4ca7800d2
1 changed files with 3 additions and 1 deletions

View File

@ -524,7 +524,10 @@ void MainWindow::setMenus(QString name, QString parentName, QAction* a )
if(a->property("added").toBool())
hasAction = true;
if(!hasAction)
{
ui->menuOperations->removeAction(a);
menu->addAction(a);
}
a->setProperty("added", true);
//If the parent menu already exists, don't create a new one.
if(menu_map.contains(parentName))
@ -540,7 +543,6 @@ void MainWindow::setMenus(QString name, QString parentName, QAction* a )
menu_map[parentName] = parentMenu;
}
parentMenu->addMenu(menu);
ui->menuOperations->removeAction(a);
}
void MainWindow::load_plugin(QString fileName, bool blacklisted)