![]() |
VR-Forces Developer's Guide
|
The menu manager can be used to lookup registered QMenu and QAction objects based on their menu paths. The QMenu and QAction objects for the menu paths defined in the application's menu configuration are automatically registered with the menu manager by the menu assembler.

Public Member Functions | |
| virtual | ~DtMenuManager () |
| virtual void | registerMenu (const DtMenuPath &path, QMenu *menu) |
| virtual void | registerMenuItem (const DtMenuPath &path, QAction *action) |
| virtual QMenu * | findMenu (const DtMenuPath &path) const |
| virtual QAction * | findMenuItem (const DtMenuPath &path) const |
| virtual void | sortMenuConfiguration (const DtMenuConfiguration &configuration) const |
| virtual bool | showMenu (const DtMenuPath &path) |
| virtual bool | hideMenu (const DtMenuPath &path) |
| virtual bool | setMenuVisible (const DtMenuPath &path, bool visible) |
| virtual bool | showMenuItem (const DtMenuPath &path) |
| virtual bool | hideMenuItem (const DtMenuPath &path) |
| virtual bool | setMenuItemVisible (const DtMenuPath &path, bool visible) |
| const std::map< DtMenuPath, QMenu * > & | menus () const |
| const std::map< DtMenuPath, QAction * > | menuItems () const |
Public Member Functions inherited from makVrv::DtVirtualBaseClass | |
| DtVirtualBaseClass () | |
| virtual | ~DtVirtualBaseClass () |
Static Public Member Functions | |
| static DtMenuManager & | instance (DtDe &de) |
Public Attributes | |
| boost::signalslib::signal < void(const DtMenuPath &)> | signal_menuDeleted |
| boost::signalslib::signal < void(const DtMenuPath &)> | signal_menuItemDeleted |
Protected Slots | |
| virtual void | onMenuDestroyed (QObject *obj) |
| virtual void | onActionDestroyed (QObject *obj) |
Protected Member Functions | |
| DtMenuManager () | |
| virtual void | addSortedNamesToMenu (QStringList sortedByName, std::map< QString, std::vector< QAction * > > sorted, QMenu *menu) const |
| virtual void | sortMenu (QMenu *, const DtMenuConfiguration::MenuSortFlags &flags, const DtMenuConfiguration &configuration) const |
Protected Attributes | |
| std::map< QPointer< QMenu > , DtMenuPath > | myMenuPaths |
| std::map< DtMenuPath, QMenu * > | myMenus |
| std::map< DtMenuPath, QAction * > | myMenuItems |
|
virtual |
DTOR.
|
protected |
Protected CTOR, use the instance function.
|
static |
Get an instance of the Menu manager.
Referenced by makVrf::DtConfigurableMenuAssembler::menuManager().
|
virtual |
Register a menu, this is done automatically by the DtMenuAssembler.
|
virtual |
Register a menu item, this is done automatically by the DtMenuAssembler.
|
virtual |
Find a menu by its path.
|
virtual |
Find a menu item by its path.
|
virtual |
|
virtual |
Show a menu by its path. Akin to calling setMenuVisible(path, true). Returns true if successful, false otherwise.
|
virtual |
Hide a menu by its path. Akin to calling setMenuVisible(path, false). Returns true if successful, false otherwise.
|
virtual |
Show/Hide a menu by its path. Returns true if successful, false otherwise.
|
virtual |
Show a menu item by its path. Akin to calling setMenuItemVisible(path, true). Returns true if successful, false otherwise.
|
virtual |
Hide a menu item by its path. Akin to calling setMenuItemVisible(path, false). Returns true if successful, false otherwise.
|
virtual |
Show/Hide a menu by its path. Returns true if successful, false otherwise.
| const std::map<DtMenuPath,QMenu*>& makVrv::DtMenuManager::menus | ( | ) | const |
Returns the list of known menus and menu items. Key is the path to the menu or menu item.
| const std::map<DtMenuPath,QAction*> makVrv::DtMenuManager::menuItems | ( | ) | const |
|
protectedvirtualslot |
When a menu is destroyed.
|
protectedvirtualslot |
When an action is destroyed.
|
protectedvirtual |
Helper function for sorting menus.
|
protectedvirtual |
Helper function for sorting menus. Recursively sort the provided QMenu based on its sort flags and the sort flags of its children menus, menu items, and/or actions.
| boost::signalslib::signal<void (const DtMenuPath&)> makVrv::DtMenuManager::signal_menuDeleted |
| boost::signalslib::signal<void (const DtMenuPath&)> makVrv::DtMenuManager::signal_menuItemDeleted |
|
protected |
|
protected |
|
protected |