Popup menu manager. More...
#include <QtxPopupMgr.h>

Data Structures | |
| class | PopupCreator |
| Popup menu actions creator. More... | |
Public Types | |
| enum | RuleType { VisibleRule, EnableRule, ToggleRule } |
Menu item rule type. 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 | |
| QtxPopupMgr (QObject *=0) | |
| Constructor. | |
| QtxPopupMgr (QMenu *, QObject *=0) | |
| Constructor. | |
| virtual | ~QtxPopupMgr () |
| Destructor. | |
| int | insertAction (const int, const int, const QString &, const RuleType=VisibleRule) |
| Insert action to the popup menu manager. | |
| int | insertAction (QAction *, const int, const QString &, const RuleType=VisibleRule) |
| Insert action to the popup menu manager. | |
| virtual int | registerAction (QAction *, const int, const QString &rule, const RuleType=VisibleRule) |
| Register an action and return its identifier. | |
| virtual void | unRegisterAction (const int) |
| Unregister action from internal map. | |
| virtual bool | isVisible (const int actId, const int place) const |
| Check if the menu item is visible. | |
| QString | rule (QAction *, const RuleType=VisibleRule) const |
| Get rule of type type for the action a. | |
| QString | rule (const int, const RuleType=VisibleRule) const |
| Get rule of type type for the action id. | |
| void | setRule (QAction *, const QString &, const RuleType=VisibleRule) |
| Set rule of type type for the action a. | |
| void | setRule (const int, const QString &, const RuleType=VisibleRule) |
| Set rule of type type for the action id. | |
| bool | hasRule (QAction *, const RuleType=VisibleRule) const |
| bool | hasRule (const int, const RuleType=VisibleRule) const |
| QtxPopupSelection * | selection () const |
| Get selection. | |
| void | setSelection (QtxPopupSelection *) |
| Set selection. | |
| QMenu * | menu () const |
| Get popup menu. | |
| void | setMenu (QMenu *) |
| Get popup menu. | |
| void | updateMenu () |
| Update popup according to the current selection. | |
| virtual bool | load (const QString &, QtxActionMgr::Reader &) |
| Load actions description from the file. | |
| QWidget * | menuWidget () const |
| Get the menu widget. | |
| 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. | |
| 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. | |
| 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 | |
| virtual void | internalUpdate () |
| Perform internal update of the popup menu according to the current selection. | |
| void | setParameters (QtxEvalParser *, QStringList &) const |
| Fill the parser with parameters of the expression. | |
| virtual bool | isSatisfied (QAction *, const RuleType=VisibleRule) const |
| Check the rule for the action. | |
| QtxEvalExpr * | expression (QAction *, const RuleType=VisibleRule, const bool=false) const |
| Get an syntax expression for the action according to the specified rule type. | |
| 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 | updateContent () |
| Called when delayed content update is performed. | |
| void | triggerUpdate () |
| Perform delayed update. | |
| int | generateId () const |
| Generate unique action identifier. | |
Private Types | |
| typedef QMap< RuleType, QtxEvalExpr * > | ExprMap |
| typedef QMap< QAction *, ExprMap > | RuleMap |
| typedef QMap< QString, QVariant > | CacheMap |
Private Slots | |
| void | onSelectionDestroyed (QObject *) |
| Called when selection is destroyed. | |
Private Member Functions | |
| bool | result (QtxEvalParser *p) const |
| Calculate an expression. | |
| QVariant | parameter (const QString &, const int=-1) const |
Private Attributes | |
| RuleMap | myRules |
| CacheMap | myCache |
| QtxPopupSelection * | mySelection |
Menu manager allows using of set of action for automatic generating of application context popup menu by reuquest and dynamic update of its contents.
Use insert() methods to add menu items to the popup menu.
The visibility, enable and toggle state of the menu item is controlled by the syntaxic rules, which can be set with setRule() methods. The rules are parsed automatically with help of QtxEvalParser class.
QtxPopupSelection class is used as back-end for getting value of each parameter found in the rule by the expression parser. Use setSelection() and selection() to set/get the selection instance for the popup menu manager.
Popup menu manager automatically optimizes the menu by removing extra separators, hiding empty popup submenus etc.
typedef QMap<RuleType, QtxEvalExpr*> QtxPopupMgr.ExprMap [private] |
typedef QMap<QAction*, ExprMap> QtxPopupMgr.RuleMap [private] |
typedef QMap<QString, QVariant> QtxPopupMgr.CacheMap [private] |
| QtxPopupMgr::QtxPopupMgr | ( | QObject * | parent = 0 | ) |
| object | parent object |
| popup | popup menu |
| object | parent object |
| QtxPopupMgr::~QtxPopupMgr | ( | ) | [virtual] |
| int QtxPopupMgr::insertAction | ( | const int | id, |
| const int | pId, | ||
| const QString & | rule, | ||
| const RuleType | ruleType = VisibleRule |
||
| ) |
| id | action ID |
| pId | parent menu action ID |
| rule | syntax rule |
| ruleType | rule type (QtxPopupMgr.RuleType) |
References QtxActionMgr.action(), QtxActionMenuMgr.insert(), and setRule().
| int QtxPopupMgr::insertAction | ( | QAction * | a, |
| const int | pId, | ||
| const QString & | rule, | ||
| const RuleType | ruleType = VisibleRule |
||
| ) |
| a | action |
| pId | parent menu action ID |
| rule | syntax rule |
| ruleType | rule type (QtxPopupMgr.RuleType) |
References QtxActionMenuMgr.insert(), and setRule().
| int QtxPopupMgr::registerAction | ( | QAction * | act, |
| const int | id, | ||
| const QString & | rule, | ||
| const RuleType | ruleType = VisibleRule |
||
| ) | [virtual] |
If id is less than 0, the identifier for the action is generated automatically. If action with given id is already registered, it will be re-registered. If required id is already in use, new identifier is generatied; in this case returning value will different from required one.
| act | action to be registered |
| id | action ID |
| rule | syntax rule |
| ruleType | rule type (QtxPopupMgr.RuleType) |
References setRule().
| void QtxPopupMgr::unRegisterAction | ( | const int | id | ) | [virtual] |
| id | action ID |
Reimplemented from QtxActionMgr.
References test_table.a, QtxActionMgr.action(), and myRules.
| bool QtxPopupMgr::isVisible | ( | const int | id, |
| const int | place | ||
| ) | const [virtual] |
| id | action ID |
| place | some parent action ID |
true if the action is visible Reimplemented from QtxActionMenuMgr.
References QtxActionMgr.action(), hasRule(), and isSatisfied().
| a | action |
| ruleType | rule type (QtxPopupMgr.RuleType) |
References QtxEvalExpr.expression(), and expression().
| QString QtxPopupMgr::rule | ( | const int | id, |
| const RuleType | ruleType = VisibleRule |
||
| ) | const |
| id | action ID |
| ruleType | rule type (QtxPopupMgr.RuleType) |
References QtxActionMgr.action(), and rule().
| void QtxPopupMgr::setRule | ( | QAction * | a, |
| const QString & | rule, | ||
| const RuleType | ruleType = VisibleRule |
||
| ) |
| a | action |
| rule | rule |
| ruleType | rule type (QtxPopupMgr.RuleType) |
References expression(), and QtxEvalExpr.setExpression().
| void QtxPopupMgr::setRule | ( | const int | id, |
| const QString & | rule, | ||
| const RuleType | ruleType = VisibleRule |
||
| ) |
| id | action ID |
| rule | rule |
| ruleType | rule type (QtxPopupMgr.RuleType) |
References QtxActionMgr.action(), and setRule().
| a | - action |
| t | - rule type |
References expression().
| bool QtxPopupMgr::hasRule | ( | const int | id, |
| const RuleType | t = VisibleRule |
||
| ) | const |
| id | - action id |
| t | - rule type |
References QtxActionMgr.action(), and hasRule().
| QtxPopupSelection * QtxPopupMgr::selection | ( | ) | const |
References mySelection.
| void QtxPopupMgr::setSelection | ( | QtxPopupSelection * | sel | ) |
| sel | new selection object |
References mySelection, onSelectionDestroyed(), and QtxActionMgr.triggerUpdate().
| QMenu * QtxPopupMgr::menu | ( | ) | const |
References QtxActionMenuMgr.menuWidget().
| void QtxPopupMgr::setMenu | ( | QMenu * | menu | ) |
| menu | popup menu |
References QtxActionMenuMgr.setMenuWidget().
| void QtxPopupMgr::updateMenu | ( | ) |
References internalUpdate().
| bool QtxPopupMgr::load | ( | const QString & | fname, |
| QtxActionMgr::Reader & | r | ||
| ) | [virtual] |
| fname | file name |
| r | action reader |
true on success and false on error Reimplemented from QtxActionMenuMgr.
References QtxActionMgr.Reader.read().
| void QtxPopupMgr::internalUpdate | ( | ) | [protected, virtual] |
Reimplemented from QtxActionMenuMgr.
References isSatisfied(), myCache, myRules, and ToggleRule.
| void QtxPopupMgr::setParameters | ( | QtxEvalParser * | p, |
| QStringList & | specific | ||
| ) | const [protected] |
The values of the parameters are given from the selection object (QtxPopupSelection).
| p | expression parser |
| returning | list of parameters names which are not retrieved from the selection |
References mySelection, parameter(), QtxEvalParser.parameters(), and QtxEvalParser.setParameter().
| bool QtxPopupMgr::isSatisfied | ( | QAction * | act, |
| const RuleType | ruleType = VisibleRule |
||
| ) | const [protected, virtual] |
| act | action |
| ruleType | rule type (QtxPopupMgr.RuleType) |
true if current selection satisfies the action rule References test_table.c, QtxEvalParser.clearParameters(), QtxPopupSelection.count(), expression(), mySelection, parameter(), QtxEvalExpr.parser(), result(), QtxEvalParser.setParameter(), and setParameters().
| QtxEvalExpr * QtxPopupMgr::expression | ( | QAction * | a, |
| const RuleType | ruleType = VisibleRule, |
||
| const bool | create = false |
||
| ) | const [protected] |
| a | action |
| ruleType | rule type (QtxPopupMgr.RuleType) |
| create | if true an expression does not exist, create it |
References test_table.a, and myRules.
| bool QtxPopupMgr::result | ( | QtxEvalParser * | p | ) | const [private] |
| p | expression parser |
true if parser has finished work without errors References QtxEvalParser.calculate(), QtxEvalParser.error(), and QtxEvalExpr.OK.
| QVariant QtxPopupMgr::parameter | ( | const QString & | name, |
| const int | idx = -1 |
||
| ) | const [private] |
References myCache, QtxPopupSelection.parameter(), and selection().
| void QtxPopupMgr::onSelectionDestroyed | ( | QObject * | o | ) | [private, slot] |
Prevents crashes when the selection object is destroyed outside the popup manager.
| o | selection object being destroyed |
References mySelection.
| QWidget * QtxActionMenuMgr::menuWidget | ( | ) | const [inherited] |
References QtxActionMenuMgr.myMenu.
| void QtxActionMenuMgr::setVisible | ( | const int | actId, |
| const int | place, | ||
| const bool | v | ||
| ) | [virtual, inherited] |
| actId | action ID |
| place | some parent action ID |
| v | new visibility state |
Reimplemented from QtxActionMgr.
References QtxActionMenuMgr.find(), and QtxActionMenuMgr.MenuNode.visible.
| int QtxActionMenuMgr::insert | ( | const int | id, |
| const QString & | menus, | ||
| const int | group, | ||
| const int | idx = -1 |
||
| ) | [inherited] |
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 |
||
| ) | [inherited] |
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 QtxActionMenuMgr.insert().
| int QtxActionMenuMgr::insert | ( | const int | id, |
| const QStringList & | menus, | ||
| const int | group, | ||
| const int | idx = -1 |
||
| ) | [inherited] |
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 QtxActionMenuMgr.createMenu(), and QtxActionMenuMgr.insert().
| int QtxActionMenuMgr::insert | ( | QAction * | a, |
| const QStringList & | menus, | ||
| const int | group, | ||
| const int | idx = -1 |
||
| ) | [inherited] |
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 QtxActionMenuMgr.createMenu(), and QtxActionMenuMgr.insert().
| int QtxActionMenuMgr::insert | ( | const int | id, |
| const int | pId, | ||
| const int | group, | ||
| const int | idx = -1 |
||
| ) | [virtual, inherited] |
| id | action ID |
| pId | parent menu action ID |
| group | group ID |
| idx | menu index inside the menu group |
References QtxActionMenuMgr.find(), QtxActionMenuMgr.MenuNode.id, QtxActionMenuMgr.myRoot, and QtxActionMgr.triggerUpdate().
| int QtxActionMenuMgr::insert | ( | QAction * | a, |
| const int | pId, | ||
| const int | group, | ||
| const int | idx = -1 |
||
| ) | [inherited] |
| a | action |
| pId | parent menu action ID |
| group | group ID |
| idx | menu index inside the menu group |
References QtxActionMenuMgr.insert(), and QtxActionMgr.registerAction().
| int QtxActionMenuMgr::insert | ( | const QString & | title, |
| const QString & | menus, | ||
| const int | group, | ||
| const int | id = -1, |
||
| const int | idx = -1 |
||
| ) | [inherited] |
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 QtxActionMenuMgr.insert().
| int QtxActionMenuMgr::insert | ( | const QString & | title, |
| const QStringList & | menus, | ||
| const int | group, | ||
| const int | id = -1, |
||
| const int | idx = -1 |
||
| ) | [inherited] |
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 QtxActionMenuMgr.createMenu(), and QtxActionMenuMgr.insert().
| int QtxActionMenuMgr::insert | ( | const QString & | title, |
| const int | pId, | ||
| const int | group, | ||
| const int | id = -1, |
||
| const int | idx = -1 |
||
| ) | [virtual, inherited] |
| 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, QtxActionMenuMgr.clearTitle(), QtxActionMenuMgr.find(), QtxActionMgr.generateId(), QtxActionMenuMgr.MenuNode.id, QtxActionMenuMgr.myMenus, QtxActionMenuMgr.myRoot, QtxActionMenuMgr.onAboutToHide(), QtxActionMenuMgr.onAboutToShow(), and QtxActionMgr.triggerUpdate().
| int QtxActionMenuMgr::append | ( | const int | id, |
| const int | pId, | ||
| const int | group | ||
| ) | [inherited] |
| id | action ID |
| pId | parent menu action ID |
| group | group ID |
References QtxActionMenuMgr.insert().
| int QtxActionMenuMgr::append | ( | QAction * | a, |
| const int | pId, | ||
| const int | group | ||
| ) | [inherited] |
| a | action |
| pId | parent menu action ID |
| group | group ID |
References QtxActionMenuMgr.insert().
| int QtxActionMenuMgr::append | ( | const QString & | title, |
| const int | pId, | ||
| const int | group, | ||
| const int | id = -1 |
||
| ) | [inherited] |
| title | menu text |
| pId | parent menu action ID |
| group | group ID |
| id | action ID |
References QtxActionMenuMgr.insert().
| int QtxActionMenuMgr::prepend | ( | const int | id, |
| const int | pId, | ||
| const int | group | ||
| ) | [inherited] |
| id | action ID |
| pId | parent menu action ID |
| group | group ID |
References QtxActionMenuMgr.insert().
| int QtxActionMenuMgr::prepend | ( | QAction * | a, |
| const int | pId, | ||
| const int | group | ||
| ) | [inherited] |
| a | action |
| pId | parent menu action ID |
| group | group ID |
References QtxActionMenuMgr.insert().
| int QtxActionMenuMgr::prepend | ( | const QString & | title, |
| const int | pId, | ||
| const int | group, | ||
| const int | id = -1 |
||
| ) | [inherited] |
| title | menu text |
| pId | parent menu action ID |
| group | group ID |
| id | action ID |
References QtxActionMenuMgr.insert().
| void QtxActionMenuMgr::remove | ( | const int | id | ) | [inherited] |
| id | menu action ID |
References QtxActionMenuMgr.removeMenu(), and QtxActionMgr.update().
| void QtxActionMenuMgr::remove | ( | const int | id, |
| const int | pId, | ||
| const int | group = -1 |
||
| ) | [inherited] |
| id | menu action ID |
| pId | parent menu action ID |
| group | group ID |
References QtxActionMenuMgr.MenuNode.children, QtxActionMenuMgr.find(), QtxActionMenuMgr.MenuNode.id, QtxActionMenuMgr.itemAction(), QtxActionMenuMgr.menuAction(), QtxActionMenuMgr.menuWidget(), QtxActionMenuMgr.myMenus, QtxActionMenuMgr.myRoot, and QtxActionMgr.triggerUpdate().
| void QtxActionMenuMgr::show | ( | const int | id | ) | [inherited] |
| void QtxActionMenuMgr::hide | ( | const int | id | ) | [inherited] |
| bool QtxActionMenuMgr::isShown | ( | const int | id | ) | const [inherited] |
| id | menu action ID |
true if an item is shown References QtxActionMenuMgr.find(), and QtxActionMenuMgr.MenuNode.visible.
| void QtxActionMenuMgr::setShown | ( | const int | id, |
| const bool | on | ||
| ) | [inherited] |
| id | menu action ID |
| on | new visibility status |
References QtxActionMenuMgr.find(), QtxActionMenuMgr.MenuNode.id, QtxActionMenuMgr.myRoot, and QtxActionMgr.triggerUpdate().
| void QtxActionMenuMgr::change | ( | const int | id, |
| const QString & | title | ||
| ) | [virtual, inherited] |
| id | menu action ID |
| title | new menu title |
References test_table.a, and QtxActionMenuMgr.menuAction().
| bool QtxActionMenuMgr::containsMenu | ( | const QString & | title, |
| const int | pid, | ||
| const bool | rec = false |
||
| ) | const [inherited] |
| title | menu title |
| pid | parent menu item ID |
true if parent menu item contains such child item References QtxActionMenuMgr.find().
| bool QtxActionMenuMgr::containsMenu | ( | const int | id, |
| const int | pid, | ||
| const bool | rec = false |
||
| ) | const [inherited] |
| id | menu item ID |
| pid | parent menu item ID |
true if parent menu item contains such child item References QtxActionMenuMgr.find().
| QMenu * QtxActionMenuMgr::findMenu | ( | const int | id | ) | const [inherited] |
| id | menu item ID |
References test_table.a, and QtxActionMenuMgr.menuAction().
| QMenu * QtxActionMenuMgr::findMenu | ( | const QString & | title, |
| const int | pid, | ||
| const bool | rec = false |
||
| ) | const [inherited] |
| title | menu text |
| pid | parent menu item ID (to start search) |
| rec | if true, perform recursive update |
References test_table.a, QtxActionMenuMgr.find(), QtxActionMenuMgr.MenuNode.id, and QtxActionMenuMgr.menuAction().
| bool QtxActionMenuMgr::isEmptyEnabled | ( | const int | id | ) | const [inherited] |
| id | menu item ID |
true if empty menu is enabled References QtxActionMenuMgr.MenuNode.emptyEnabled, QtxActionMenuMgr.find(), and QtxActionMenuMgr.menuAction().
| void QtxActionMenuMgr::setEmptyEnabled | ( | const int | id, |
| const bool | enable | ||
| ) | [inherited] |
| id | menu item ID |
| enable | if true, empty menu will be enabled, otherwise empty menu will be disabled |
References QtxActionMenuMgr.MenuNode.emptyEnabled, QtxActionMenuMgr.find(), QtxActionMenuMgr.menuAction(), and QtxActionMenuMgr.updateMenu().
| void QtxActionMenuMgr::menuAboutToShow | ( | QMenu * | m | ) | [signal, inherited] |
| m | menu being shown |
| void QtxActionMenuMgr::menuAboutToHide | ( | QMenu * | m | ) | [signal, inherited] |
| m | menu being hidden |
| void QtxActionMenuMgr::setMenuWidget | ( | QWidget * | mw | ) | [protected, inherited] |
| mw | new menu widget |
References QtxActionMenuMgr.myMenu, QtxActionMenuMgr.onDestroyed(), and QtxActionMgr.triggerUpdate().
| QtxActionMenuMgr::MenuNode * QtxActionMenuMgr::find | ( | const int | id, |
| const int | pId, | ||
| const bool | rec = true |
||
| ) | const [protected, inherited] |
| 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, inherited] |
| id | menu action ID |
| startNode | start menu node (if 0, search from root node) |
| rec | if true perform recursive search |
References QtxActionMenuMgr.MenuNode.children, QtxActionMenuMgr.find(), and QtxActionMenuMgr.myRoot.
| bool QtxActionMenuMgr::find | ( | const int | id, |
| NodeList & | lst, | ||
| MenuNode * | startNode = 0 |
||
| ) | const [protected, inherited] |
| 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, QtxActionMenuMgr.find(), QtxActionMenuMgr.MenuNode.id, and QtxActionMenuMgr.myRoot.
| QtxActionMenuMgr::MenuNode * QtxActionMenuMgr::find | ( | const QString & | title, |
| const int | pId, | ||
| const bool | rec = true |
||
| ) | const [protected, inherited] |
| title | menu item title |
| pId | parent menu item ID |
| rec | if true perform recursive search |
References QtxActionMenuMgr.find().
| QtxActionMenuMgr::MenuNode * QtxActionMenuMgr::find | ( | const QString & | title, |
| MenuNode * | startNode = 0, |
||
| const bool | rec = true |
||
| ) | const [protected, inherited] |
| 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, QtxActionMenuMgr.clearTitle(), QtxActionMenuMgr.find(), QtxActionMenuMgr.itemAction(), QtxActionMenuMgr.menuAction(), and QtxActionMenuMgr.myRoot.
| bool QtxActionMenuMgr::find | ( | const QString & | title, |
| NodeList & | lst, | ||
| MenuNode * | startNode = 0 |
||
| ) | const [protected, inherited] |
| 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, QtxActionMenuMgr.clearTitle(), QtxActionMenuMgr.find(), QtxActionMenuMgr.itemAction(), QtxActionMenuMgr.menuAction(), and QtxActionMenuMgr.myRoot.
| int QtxActionMenuMgr::findId | ( | const int | id, |
| const int | pid = -1 |
||
| ) | const [protected, inherited] |
| id | menu action ID |
| pid | parent meun item ID |
References QtxActionMenuMgr.MenuNode.children, QtxActionMenuMgr.find(), and QtxActionMenuMgr.myRoot.
| void QtxActionMenuMgr::removeMenu | ( | const int | id, |
| MenuNode * | startNode | ||
| ) | [protected, inherited] |
| id | menu action ID |
| startNode | parent menu node which search starts from (if 0, search starts from root) |
References QtxActionMenuMgr.MenuNode.children, and QtxActionMenuMgr.myRoot.
| QAction * QtxActionMenuMgr::itemAction | ( | const int | id | ) | const [protected, inherited] |
| QAction * QtxActionMenuMgr::menuAction | ( | const int | id | ) | const [protected, inherited] |
| id | submenu ID |
References test_table.a, and QtxActionMenuMgr.myMenus.
| int QtxActionMenuMgr::menuActionId | ( | QAction * | a | ) | const [protected, inherited] |
| id | submenu ID |
References test_table.a, and QtxActionMenuMgr.myMenus.
| void QtxActionMenuMgr::updateMenu | ( | MenuNode * | startNode = 0, |
| const bool | rec = true, |
||
| const bool | updParent = true |
||
| ) | [protected, inherited] |
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, QtxActionMenuMgr.checkWidget(), QtxActionMenuMgr.MenuNode.children, QtxActionMenuMgr.MenuNode.emptyEnabled, QtxActionMenuMgr.MenuNode.id, QtxActionMgr.isUpdatesEnabled(), QtxActionMenuMgr.isVisible(), QtxActionMenuMgr.itemAction(), QtxActionMenuMgr.menuAction(), QtxActionMenuMgr.menuWidget(), QtxActionMenuMgr.myRoot, QtxActionMenuMgr.ownAction(), QtxActionMenuMgr.MenuNode.parent, and QtxActionMenuMgr.simplifySeparators().
| void QtxActionMenuMgr::updateContent | ( | ) | [protected, virtual, inherited] |
Customizes the content update operation.
Reimplemented from QtxActionMgr.
References QtxActionMenuMgr.find(), QtxActionMenuMgr.myRoot, QtxActionMenuMgr.myUpdateIds, and QtxActionMenuMgr.updateMenu().
| void QtxActionMgr::triggerUpdate | ( | ) | [protected, inherited] |
Does nothing if update is disabled.
References QtxActionMgr.isUpdatesEnabled(), QtxActionMgr.myUpdTimer, and QtxActionMgr.onUpdateContent().
| 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().
| 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] |
RuleMap QtxPopupMgr.myRules [private] |
CacheMap QtxPopupMgr.myCache [private] |
QtxPopupSelection* QtxPopupMgr.mySelection [private] |