Gui: extend Workbench class to allow to define permanent menu items
This commit is contained in:
@@ -84,6 +84,23 @@ MenuItem* MenuItem::findItem(const std::string& name)
|
||||
return 0;
|
||||
}
|
||||
|
||||
MenuItem* MenuItem::findParentOf(const std::string& name)
|
||||
{
|
||||
for (QList<MenuItem*>::Iterator it = _items.begin(); it != _items.end(); ++it)
|
||||
{
|
||||
if ((*it)->_name == name)
|
||||
return this;
|
||||
}
|
||||
|
||||
for (QList<MenuItem*>::Iterator it = _items.begin(); it != _items.end(); ++it)
|
||||
{
|
||||
if ((*it)->findParentOf(name))
|
||||
return *it;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MenuItem* MenuItem::copy() const
|
||||
{
|
||||
MenuItem* root = new MenuItem;
|
||||
|
||||
Reference in New Issue
Block a user