Main menu actions manager. More...
#include <QtxActionMenuMgr.h>

Data Structures | |
| class | MenuCreator |
| Menu actions creator. More... | |
| class | MenuNode |
| Represents a menu item inside main menu structure. More... | |
Signals | |
| void | menuAboutToShow (QMenu *) |
| Emitted when the menu is about to be shown. | |
| void | menuAboutToHide (QMenu *) |
| Emitted when the menu is about to be hidden. | |
Public Member Functions | |
| QtxActionMenuMgr (QMainWindow *) | |
| Constructor. | |
| QtxActionMenuMgr (QWidget *, QObject *) | |
| Constructor. | |
| virtual | ~QtxActionMenuMgr () |
| Destructor. | |
| QWidget * | menuWidget () const |
| Get the menu widget. | |
| virtual bool | isVisible (const int, const int) const |
| Check if an action with actId identifier is visible to the parent action with place identifier. | |
| virtual void | setVisible (const int, const int, const bool) |
| Set action's visibility flag. | |
| int | insert (const int, const QString &, const int, const int=-1) |
| Insert action to the menu. | |
| int | insert (QAction *, const QString &, const int, const int=-1) |
| Insert action to the menu. | |
| int | insert (const int, const QStringList &, const int, const int=-1) |
| Insert action to the menu. | |
| int | insert (QAction *, const QStringList &, const int, const int=-1) |
| Insert action to the menu. | |
| virtual int | insert (const int, const int, const int, const int=-1) |
| Insert action to the menu. | |
| int | insert (QAction *, const int, const int, const int=-1) |
| Insert action to the menu. | |
| int | insert (const QString &, const QString &, const int, const int=-1, const int=-1) |
| Create and insert menu item action to the menu. | |
| int | insert (const QString &, const QStringList &, const int, const int=-1, const int=-1) |
| Create and insert menu item action to the menu. | |
| virtual int | insert (const QString &, const int, const int, const int=-1, const int=-1) |
| Create and insert menu item action to the menu. | |
| int | append (const int, const int, const int) |
| Create and add menu item action to the end of menu. | |
| int | append (QAction *, const int, const int) |
| Create and add menu item action to the end of menu. | |
| int | append (const QString &, const int, const int, const int=-1) |
| Create and add menu item action to the end of menu. | |
| int | prepend (const int, const int, const int) |
| Create and add menu item action to the beginning of menu. | |
| int | prepend (QAction *, const int, const int) |
| Create and add menu item action to the beginning of menu. | |
| int | prepend (const QString &, const int, const int, const int=-1) |
| Create and add menu item action to the beginning of menu. | |
| void | remove (const int) |
| Remove menu item with given id. | |
| void | remove (const int, const int, const int=-1) |
| Remove menu item with given id. | |
| void | show (const int) |
| Show menu item with given id. | |
| void | hide (const int) |
| Hide menu item with given id. | |
| bool | isShown (const int) const |
| Get visibility status for menu item with given id. | |
| void | setShown (const int, const bool) |
| Set visibility status for menu item with given id. | |
| virtual void | change (const int, const QString &) |
| Change menu title for the action with given id. | |
| virtual bool | load (const QString &, QtxActionMgr::Reader &) |
| Load actions description from the file. | |
| bool | containsMenu (const QString &, const int, const bool=false) const |
| Check if the parent menu contains menu item with given title. | |
| bool | containsMenu (const int, const int, const bool=false) const |
| Check if the parent menu contains menu item with given id. | |
| QMenu * | findMenu (const int) const |
| Get menu by the specified identifier. | |
| QMenu * | findMenu (const QString &, const int, const bool=false) const |
| Get menu by the title. | |
| bool | isEmptyEnabled (const int) const |
| Check if empty menu is enabled. | |
| void | setEmptyEnabled (const int, const bool) |
| Enable/disable empty menu. | |
| virtual int | registerAction (QAction *, const int=-1) |
| Register an action in the internal map. | |
| virtual void | unRegisterAction (const int) |
| Unregister action from internal map. | |
| QAction * | action (const int) const |
| Get action by specified identifier. | |
| int | actionId (const QAction *) const |
| Get action identifier. | |
| bool | contains (const int) const |
| Check if an action with given id is registered in the action manager. | |
| int | count () const |
| Get total number of registered actions. | |
| bool | isEmpty () const |
| Check if there are no actions registered in the action manager. | |
| QIntList | idList () const |
| Get all registered actions identifiers. | |
| bool | isUpdatesEnabled () const |
| Check if update is enabled. | |
| virtual void | setUpdatesEnabled (const bool) |
| Enable/disable update operation. | |
| void | update () |
| Update actions. | |
| virtual bool | isEnabled (const int) const |
| Check is action with given id is enabled. | |
| virtual void | setEnabled (const int, const bool) |
Static Public Member Functions | |
| static QAction * | separator (const bool=false) |
| Create new separator action. | |
Protected Member Functions | |
| void | setMenuWidget (QWidget *) |
| Assign new menu widget to the menu manager. | |
| MenuNode * | find (const int, const int, const bool=true) const |
| Search menu node. | |
| MenuNode * | find (const int, MenuNode *=0, const bool=true) const |
| Search menu node. | |
| bool | find (const int, NodeList &, MenuNode *=0) const |
| Search recursively all menu nodes with given id. | |
| MenuNode * | find (const QString &, const int, const bool=true) const |
| Search menu node. | |
| MenuNode * | find (const QString &, MenuNode *=0, const bool=true) const |
| Search menu node. | |
| bool | find (const QString &, NodeList &, MenuNode *=0) const |
| Search recursively all menu nodes with given title. | |
| int | findId (const int, const int=-1) const |
| Find menu item by given ID (one-level only). | |
| void | removeMenu (const int, MenuNode *) |
| Removes menu node (with all its children). | |
| QAction * | itemAction (const int) const |
| Get action by id. | |
| QAction * | menuAction (const int) const |
| Get submenu action by id. | |
| int | menuActionId (QAction *) const |
| Get submenu action by id. | |
| void | updateMenu (MenuNode *=0, const bool=true, const bool=true) |
| Update menu. | |
| virtual void | internalUpdate () |
| Internal update. | |
| virtual void | updateContent () |
| Called when delayed content update is performed. | |
| int | generateId () const |
| Generate unique action identifier. | |
| void | triggerUpdate () |
| Perform delayed update. | |
Private Types | |
| typedef QList< MenuNode * > | NodeList |
| menu nodes list | |
| typedef QMap< int, QAction * > | MenuMap |
| actions map | |
Private Slots | |
| void | onAboutToShow () |
| Called when the submenu is about to show. | |
| void | onAboutToHide () |
| Called when the submenu is about to hide. | |
| void | onDestroyed (QObject *) |
| Called when the corresponding menu object is destroyed. | |
Private Member Functions | |
| bool | ownAction (QAction *, MenuNode *) const |
| Check if action belongs to the menu manager. | |
| bool | checkWidget (QWidget *) const |
| Check if menu widget has any actions. | |
| QWidget * | menuWidget (MenuNode *) const |
| Get menu widget for the given node. | |
| void | simplifySeparators (QWidget *) |
| Remove extra separators from menu widget. | |
| QString | clearTitle (const QString &) const |
| Remove special symbols (&) from string to get clear menu title. | |
| int | createMenu (const QStringList &, const int) |
| Create and inserts menu item recursively. | |
| void | triggerUpdate (const int, const bool rec=true) |
| Perform delayed menu update. | |
Private Attributes | |
| MenuNode * | myRoot |
| root menu node | |
| QWidget * | myMenu |
| menu widget | |
| MenuMap | myMenus |
| actions map | |
| QMap< int, bool > | myUpdateIds |
| list of actions ID being updated | |
Menu manager allows using of set of action for automatic generating of application main menu and dynamic update of its contents.
Use insert(), append() and remove() methods to create main menu. Methods show(), hide() allow displaying/erasing of specified menu items.
Actions can be grouped with help of group identificator. Inside the popup or main menu bar menu items are ordered by the group identifier (ascending).
Menu manager automatically optimizes the menu by removing extra separators, hiding empty popup menus etc.
typedef QList<MenuNode*> QtxActionMenuMgr.NodeList [private] |
typedef QMap<int, QAction*> QtxActionMenuMgr.MenuMap [private] |
| QtxActionMenuMgr::QtxActionMenuMgr | ( | QMainWindow * | p | ) |
| p | parent main window |
References myMenu, and onDestroyed().
| mw | menu widget |
| p | parent object |
References myMenu, and onDestroyed().
| QtxActionMenuMgr::~QtxActionMenuMgr | ( | ) | [virtual] |
References test_table.a, myMenus, and myRoot.
| bool QtxActionMenuMgr::isVisible | ( | const int | actId, |
| const int | place | ||
| ) | const [virtual] |
| actId | action ID |
| place | some parent action ID |
true if an action is visible to the parent Reimplemented from QtxActionMgr.
Reimplemented in QtxPopupMgr.
References find(), and QtxActionMenuMgr.MenuNode.visible.
| void QtxActionMenuMgr::setVisible | ( | const int | actId, |
| const int | place, | ||
| const bool | v | ||
| ) | [virtual] |
| actId | action ID |
| place | some parent action ID |
| v | new visibility state |
Reimplemented from QtxActionMgr.
References find(), and QtxActionMenuMgr.MenuNode.visible.
| int QtxActionMenuMgr::insert | ( | const int | id, |
| const QString & | menus, | ||
| const int | group, | ||
| const int | idx = -1 |
||
| ) |
Insert an action to the named menu. The menus parameter represents the menu name: it can be a sequence of strings, separated by '|' symbol. For example, "File|Edit" means File->Edit submenu. If submenu doesn't exist, it will be created.
| id | action ID |
| menus | menu name |
| group | group ID |
| idx | menu index inside the menu group |
| int QtxActionMenuMgr::insert | ( | QAction * | a, |
| const QString & | menus, | ||
| const int | group, | ||
| const int | idx = -1 |
||
| ) |
Insert an action to the named menu. The menus parameter represents the menu name: it can be a sequence of strings, separated by '|' symbol. For example, "File|Edit" means File->Edit submenu. If submenu doesn't exist, it will be created.
| a | action |
| menus | menu name |
| group | group ID |
| idx | menu index inside the menu group |
References insert().
| int QtxActionMenuMgr::insert | ( | const int | id, |
| const QStringList & | menus, | ||
| const int | group, | ||
| const int | idx = -1 |
||
| ) |
Insert an action to the named menu. The menus parameter represents the menu names list. For example, string list consisting from two items "File" and "Edit" means File->Edit submenu. If submenu doesn't exist, it will be created.
| id | action ID |
| menus | menu names list |
| group | group ID |
| idx | menu index inside the menu group |
References createMenu(), and insert().
| int QtxActionMenuMgr::insert | ( | QAction * | a, |
| const QStringList & | menus, | ||
| const int | group, | ||
| const int | idx = -1 |
||
| ) |
Insert an action to the named menu. The menus parameter represents the menu names list. For example, string list consisting from two items "File" and "Edit" means File->Edit submenu. If submenu doesn't exist, it will be created.
| a | action |
| menus | menu names list |
| group | group ID |
| idx | menu index inside the menu group |
References createMenu(), and insert().
| int QtxActionMenuMgr::insert | ( | const int | id, |
| const int | pId, | ||
| const int | group, | ||
| const int | idx = -1 |
||
| ) | [virtual] |
| id | action ID |
| pId | parent menu action ID |
| group | group ID |
| idx | menu index inside the menu group |
References find(), QtxActionMenuMgr.MenuNode.id, myRoot, and QtxActionMgr.triggerUpdate().
| int QtxActionMenuMgr::insert | ( | QAction * | a, |
| const int | pId, | ||
| const int | group, | ||
| const int | idx = -1 |
||
| ) |
| a | action |
| pId | parent menu action ID |
| group | group ID |
| idx | menu index inside the menu group |
References insert(), and QtxActionMgr.registerAction().
| int QtxActionMenuMgr::insert | ( | const QString & | title, |
| const QString & | menus, | ||
| const int | group, | ||
| const int | id = -1, |
||
| const int | idx = -1 |
||
| ) |
Insert an action to the named menu. The menus parameter represents the menu name: it can be a sequence of strings, separated by '|' symbol. For example, "File|Edit" means File->Edit submenu. If submenu doesn't exist, it will be created.
| title | menu text |
| menus | menu name |
| group | group ID |
| id | action ID |
| idx | menu index inside the menu group |
References insert().
| int QtxActionMenuMgr::insert | ( | const QString & | title, |
| const QStringList & | menus, | ||
| const int | group, | ||
| const int | id = -1, |
||
| const int | idx = -1 |
||
| ) |
Insert an action to the named menu. The menus parameter represents the menu names list. For example, string list consisting from two items "File" and "Edit" means File->Edit submenu. If submenu doesn't exist, it will be created.
| title | menu text |
| menus | menu names list |
| group | group ID |
| id | action ID |
| idx | menu index inside the menu group |
References createMenu(), and insert().
| int QtxActionMenuMgr::insert | ( | const QString & | title, |
| const int | pId, | ||
| const int | group, | ||
| const int | id = -1, |
||
| const int | idx = -1 |
||
| ) | [virtual] |
| title | menu text |
| pId | parent menu action ID |
| group | group ID |
| id | action ID |
| idx | menu index inside the menu group |
References QtxActionMenuMgr.MenuNode.children, clearTitle(), find(), QtxActionMgr.generateId(), QtxActionMenuMgr.MenuNode.id, myMenus, myRoot, onAboutToHide(), onAboutToShow(), and QtxActionMgr.triggerUpdate().
| int QtxActionMenuMgr::append | ( | const int | id, |
| const int | pId, | ||
| const int | group | ||
| ) |
| id | action ID |
| pId | parent menu action ID |
| group | group ID |
References insert().
| int QtxActionMenuMgr::append | ( | QAction * | a, |
| const int | pId, | ||
| const int | group | ||
| ) |
| int QtxActionMenuMgr::append | ( | const QString & | title, |
| const int | pId, | ||
| const int | group, | ||
| const int | id = -1 |
||
| ) |
| title | menu text |
| pId | parent menu action ID |
| group | group ID |
| id | action ID |
References insert().
| int QtxActionMenuMgr::prepend | ( | const int | id, |
| const int | pId, | ||
| const int | group | ||
| ) |
| id | action ID |
| pId | parent menu action ID |
| group | group ID |
References insert().
| int QtxActionMenuMgr::prepend | ( | QAction * | a, |
| const int | pId, | ||
| const int | group | ||
| ) |
| int QtxActionMenuMgr::prepend | ( | const QString & | title, |
| const int | pId, | ||
| const int | group, | ||
| const int | id = -1 |
||
| ) |
| title | menu text |
| pId | parent menu action ID |
| group | group ID |
| id | action ID |
References insert().
| void QtxActionMenuMgr::remove | ( | const int | id | ) |
| id | menu action ID |
References removeMenu(), and QtxActionMgr.update().
| void QtxActionMenuMgr::remove | ( | const int | id, |
| const int | pId, | ||
| const int | group = -1 |
||
| ) |
| id | menu action ID |
| pId | parent menu action ID |
| group | group ID |
References QtxActionMenuMgr.MenuNode.children, find(), QtxActionMenuMgr.MenuNode.id, itemAction(), menuAction(), menuWidget(), myMenus, myRoot, and QtxActionMgr.triggerUpdate().
| void QtxActionMenuMgr::show | ( | const int | id | ) |
| void QtxActionMenuMgr::hide | ( | const int | id | ) |
| bool QtxActionMenuMgr::isShown | ( | const int | id | ) | const |
| id | menu action ID |
true if an item is shown References find(), and QtxActionMenuMgr.MenuNode.visible.
| void QtxActionMenuMgr::setShown | ( | const int | id, |
| const bool | on | ||
| ) |
| id | menu action ID |
| on | new visibility status |
References find(), QtxActionMenuMgr.MenuNode.id, myRoot, and QtxActionMgr.triggerUpdate().
| void QtxActionMenuMgr::change | ( | const int | id, |
| const QString & | title | ||
| ) | [virtual] |
| id | menu action ID |
| title | new menu title |
References test_table.a, and menuAction().
| bool QtxActionMenuMgr::load | ( | const QString & | fname, |
| QtxActionMgr::Reader & | r | ||
| ) | [virtual] |
| fname | file name |
| r | action reader |
true on success and false on error Reimplemented in QtxPopupMgr.
References QtxActionMgr.Reader.read().
| bool QtxActionMenuMgr::containsMenu | ( | const QString & | title, |
| const int | pid, | ||
| const bool | rec = false |
||
| ) | const |
| title | menu title |
| pid | parent menu item ID |
true if parent menu item contains such child item References find().
| bool QtxActionMenuMgr::containsMenu | ( | const int | id, |
| const int | pid, | ||
| const bool | rec = false |
||
| ) | const |
| id | menu item ID |
| pid | parent menu item ID |
true if parent menu item contains such child item References find().
| QMenu * QtxActionMenuMgr::findMenu | ( | const int | id | ) | const |
| id | menu item ID |
References test_table.a, and menuAction().
| QMenu * QtxActionMenuMgr::findMenu | ( | const QString & | title, |
| const int | pid, | ||
| const bool | rec = false |
||
| ) | const |
| title | menu text |
| pid | parent menu item ID (to start search) |
| rec | if true, perform recursive update |
References test_table.a, find(), QtxActionMenuMgr.MenuNode.id, and menuAction().
| bool QtxActionMenuMgr::isEmptyEnabled | ( | const int | id | ) | const |
| id | menu item ID |
true if empty menu is enabled References QtxActionMenuMgr.MenuNode.emptyEnabled, find(), and menuAction().
| void QtxActionMenuMgr::setEmptyEnabled | ( | const int | id, |
| const bool | enable | ||
| ) |
| id | menu item ID |
| enable | if true, empty menu will be enabled, otherwise empty menu will be disabled |
References QtxActionMenuMgr.MenuNode.emptyEnabled, find(), menuAction(), and updateMenu().
| void QtxActionMenuMgr::onAboutToShow | ( | ) | [private, slot] |
Emits the signal menuAboutToShow(QMenu*).
References menuAboutToShow().
| void QtxActionMenuMgr::onAboutToHide | ( | ) | [private, slot] |
Emits the signal menuAboutToHide(QMenu*).
References menuAboutToHide().
| void QtxActionMenuMgr::onDestroyed | ( | QObject * | obj | ) | [private, slot] |
Clears internal pointer to menu to disable crashes.
| obj | (menu) object being destroyed |
References myMenu.
| void QtxActionMenuMgr::menuAboutToShow | ( | QMenu * | m | ) | [signal] |
| m | menu being shown |
| void QtxActionMenuMgr::menuAboutToHide | ( | QMenu * | m | ) | [signal] |
| m | menu being hidden |
| void QtxActionMenuMgr::setMenuWidget | ( | QWidget * | mw | ) | [protected] |
| mw | new menu widget |
References myMenu, onDestroyed(), and QtxActionMgr.triggerUpdate().
| QtxActionMenuMgr::MenuNode * QtxActionMenuMgr::find | ( | const int | id, |
| const int | pId, | ||
| const bool | rec = true |
||
| ) | const [protected] |
| id | menu action ID |
| pId | parent menu item ID |
| rec | if true perform recursive search |
| QtxActionMenuMgr::MenuNode * QtxActionMenuMgr::find | ( | const int | id, |
| MenuNode * | startNode = 0, |
||
| const bool | rec = true |
||
| ) | const [protected] |
| id | menu action ID |
| startNode | start menu node (if 0, search from root node) |
| rec | if true perform recursive search |
References QtxActionMenuMgr.MenuNode.children, find(), and myRoot.
| bool QtxActionMenuMgr::find | ( | const int | id, |
| NodeList & | lst, | ||
| MenuNode * | startNode = 0 |
||
| ) | const [protected] |
| id | menu action ID |
| NodeList | resulting list of menu nodes |
| startNode | start menu node (if 0, search from root node) |
true if at least one node is found References QtxActionMenuMgr.MenuNode.children, find(), QtxActionMenuMgr.MenuNode.id, and myRoot.
| QtxActionMenuMgr::MenuNode * QtxActionMenuMgr::find | ( | const QString & | title, |
| const int | pId, | ||
| const bool | rec = true |
||
| ) | const [protected] |
| title | menu item title |
| pId | parent menu item ID |
| rec | if true perform recursive search |
References find().
| QtxActionMenuMgr::MenuNode * QtxActionMenuMgr::find | ( | const QString & | title, |
| MenuNode * | startNode = 0, |
||
| const bool | rec = true |
||
| ) | const [protected] |
| title | menu item title |
| startNode | start menu node (if 0, search from root node) |
| rec | if true perform recursive search |
References test_table.a, QtxActionMenuMgr.MenuNode.children, clearTitle(), find(), itemAction(), menuAction(), and myRoot.
| bool QtxActionMenuMgr::find | ( | const QString & | title, |
| NodeList & | lst, | ||
| MenuNode * | startNode = 0 |
||
| ) | const [protected] |
| title | menu item title |
| NodeList | resulting list of menu nodes |
| startNode | start menu node (if 0, search from root node) |
true if at least one node is found References test_table.a, QtxActionMenuMgr.MenuNode.children, clearTitle(), find(), itemAction(), menuAction(), and myRoot.
| int QtxActionMenuMgr::findId | ( | const int | id, |
| const int | pid = -1 |
||
| ) | const [protected] |
| id | menu action ID |
| pid | parent meun item ID |
References QtxActionMenuMgr.MenuNode.children, find(), and myRoot.
| void QtxActionMenuMgr::removeMenu | ( | const int | id, |
| MenuNode * | startNode | ||
| ) | [protected] |
| id | menu action ID |
| startNode | parent menu node which search starts from (if 0, search starts from root) |
References QtxActionMenuMgr.MenuNode.children, and myRoot.
| QAction * QtxActionMenuMgr::itemAction | ( | const int | id | ) | const [protected] |
| QAction * QtxActionMenuMgr::menuAction | ( | const int | id | ) | const [protected] |
| id | submenu ID |
References test_table.a, and myMenus.
| int QtxActionMenuMgr::menuActionId | ( | QAction * | a | ) | const [protected] |
| id | submenu ID |
References test_table.a, and myMenus.
| void QtxActionMenuMgr::updateMenu | ( | MenuNode * | startNode = 0, |
| const bool | rec = true, |
||
| const bool | updParent = true |
||
| ) | [protected] |
Does nothing if update is disabled.
| startNode | start menu item to be updated |
| rec | if true, perform recursive update |
| updParent | if true update also parent item (without recursion) |
References test_table.a, checkWidget(), QtxActionMenuMgr.MenuNode.children, QtxActionMenuMgr.MenuNode.emptyEnabled, QtxActionMenuMgr.MenuNode.id, QtxActionMgr.isUpdatesEnabled(), isVisible(), itemAction(), menuAction(), menuWidget(), myRoot, ownAction(), QtxActionMenuMgr.MenuNode.parent, and simplifySeparators().
| void QtxActionMenuMgr::internalUpdate | ( | ) | [protected, virtual] |
Customizes the menu update processing.
Reimplemented from QtxActionMgr.
Reimplemented in QtxPopupMgr.
References QtxActionMgr.isUpdatesEnabled(), myUpdateIds, and updateMenu().
| void QtxActionMenuMgr::updateContent | ( | ) | [protected, virtual] |
Customizes the content update operation.
Reimplemented from QtxActionMgr.
References find(), myRoot, myUpdateIds, and updateMenu().
| a | action being checked |
| node | parent menu node |
true if action belongs to the menu node References QtxActionMenuMgr.MenuNode.children, itemAction(), and menuAction().
| bool QtxActionMenuMgr::checkWidget | ( | QWidget * | wid | ) | const [private] |
| wid | widget to be checked |
true if widget contains action(s) | node | menu node |
References QtxActionMenuMgr.MenuNode.id, myMenu, myMenus, and myRoot.
| void QtxActionMenuMgr::simplifySeparators | ( | QWidget * | wid | ) | [private] |
| wid | menu widget to be processed |
| QString QtxActionMenuMgr::clearTitle | ( | const QString & | txt | ) | const [private] |
| txt | string to be processed |
| int QtxActionMenuMgr::createMenu | ( | const QStringList & | lst, |
| const int | pId | ||
| ) | [private] |
| lst | list of menu names |
| pId | parent menu item ID |
References insert().
| void QtxActionMenuMgr::triggerUpdate | ( | const int | id, |
| const bool | rec = true |
||
| ) | [private] |
| id | menu item ID |
| rec | if true, perform recursive update |
References myUpdateIds, and QtxActionMgr.triggerUpdate().
| int QtxActionMgr::registerAction | ( | QAction * | a, |
| const int | userId = -1 |
||
| ) | [virtual, inherited] |
If userId is less than 0, the identifier for the action is generated automatically. If action with given userId is already registered, it will be re-registered.
| a | action to be registered |
| userId | action ID |
References QtxActionMgr.actionId(), QtxActionMgr.contains(), QtxActionMgr.generateId(), QtxActionMgr.myActions, and QtxActionMgr.unRegisterAction().
| void QtxActionMgr::unRegisterAction | ( | const int | id | ) | [virtual, inherited] |
| id | action ID |
Reimplemented in QtxPopupMgr.
References QtxActionMgr.contains(), and QtxActionMgr.myActions.
| QAction * QtxActionMgr::action | ( | const int | id | ) | const [inherited] |
| id | action ID |
References QtxActionMgr.contains(), and QtxActionMgr.myActions.
| int QtxActionMgr::actionId | ( | const QAction * | a | ) | const [inherited] |
| a | action |
References test_table.a, and QtxActionMgr.myActions.
| bool QtxActionMgr::contains | ( | const int | id | ) | const [inherited] |
| id | action ID |
true if internal map contains action with such identifier References QtxActionMgr.myActions.
| int QtxActionMgr::count | ( | ) | const [inherited] |
| bool QtxActionMgr::isEmpty | ( | ) | const [inherited] |
| QIntList QtxActionMgr::idList | ( | ) | const [inherited] |
References QtxActionMgr.myActions.
| bool QtxActionMgr::isUpdatesEnabled | ( | ) | const [inherited] |
true if update is enabled References QtxActionMgr.myUpdate.
| void QtxActionMgr::setUpdatesEnabled | ( | const bool | upd | ) | [virtual, inherited] |
| void QtxActionMgr::update | ( | ) | [inherited] |
Calls virtual function internalUpdate to update the contents. Does nothing if update is disabled.
References QtxActionMgr.internalUpdate(), QtxActionMgr.isUpdatesEnabled(), and QtxActionMgr.myUpdTimer.
| bool QtxActionMgr::isEnabled | ( | const int | id | ) | const [virtual, inherited] |
| id | action ID |
true if action is enabled References test_table.a, and QtxActionMgr.action().
| void QtxActionMgr::setEnabled | ( | const int | id, |
| const bool | enable | ||
| ) | [virtual, inherited] |
Enable/disable action with given id.
| id | action ID |
| enable | new state |
References test_table.a, and QtxActionMgr.action().
| QAction * QtxActionMgr::separator | ( | const bool | own = false | ) | [static, inherited] |
If own is true, then the caller is responsible for the action destroying. If own is false, new separator action will be owned by the action manager which will destroy it on application exit.
| own | ownership flag |
References test_table.a, and qtxSeparatorActionCleanup().
| int QtxActionMgr::generateId | ( | ) | const [protected, inherited] |
| void QtxActionMgr::triggerUpdate | ( | ) | [protected, inherited] |
Does nothing if update is disabled.
References QtxActionMgr.isUpdatesEnabled(), QtxActionMgr.myUpdTimer, and QtxActionMgr.onUpdateContent().
MenuNode* QtxActionMenuMgr.myRoot [private] |
QWidget* QtxActionMenuMgr.myMenu [private] |
MenuMap QtxActionMenuMgr.myMenus [private] |
QMap<int, bool> QtxActionMenuMgr.myUpdateIds [private] |