mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
AppFwk : Remove sub menu action if sub menu is empty
This commit is contained in:
parent
7f137a3e7c
commit
4377ac2a6b
@ -164,7 +164,21 @@ void CmdFeatureMenuBuilder::appendToMenu(QMenu* menu)
|
||||
{
|
||||
if (menus.size() > 1)
|
||||
{
|
||||
QMenu* completeSubMenu = menus.back();
|
||||
menus.pop_back();
|
||||
|
||||
if (!menus.empty())
|
||||
{
|
||||
// Remove the sub menu action if no (sub) actions are present in the sub menu
|
||||
if (completeSubMenu->actions().isEmpty())
|
||||
{
|
||||
QMenu* menuWithEmptySubMenu = menus.back();
|
||||
|
||||
QAction* subMenuAction = completeSubMenu->menuAction();
|
||||
|
||||
menuWithEmptySubMenu->removeAction(subMenuAction);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user