VirtualBox

Changeset 76773 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jan 11, 2019 12:59:21 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:5823: UIActionPool: A possiblity to create/acquire action groups.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/globals
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp

    r76606 r76773  
    22782278{
    22792279    return qobject_cast<UIActionPoolManager*>(this);
     2280}
     2281
     2282QActionGroup *UIActionPool::actionGroup(int iIndex) const
     2283{
     2284    AssertReturn(m_groupPool.contains(iIndex), 0);
     2285    return m_groupPool.value(iIndex);
    22802286}
    22812287
     
    25172523void UIActionPool::cleanupPool()
    25182524{
    2519     /* Cleanup pool: */
     2525    qDeleteAll(m_groupPool);
    25202526    qDeleteAll(m_pool);
    25212527}
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h

    r76581 r76773  
    526526    QList<UIAction*> actions() const { return m_pool.values(); }
    527527
     528    /** Returns the action group for the passed @a iIndex.
     529      * @note Only menu actions can have action groups. */
     530    QActionGroup *actionGroup(int iIndex) const;
     531
    528532    /** Returns the list of main menus. */
    529533    QList<QMenu*> menus() const { return m_mainMenus; }
     
    641645    /** Holds the map of actions. */
    642646    QMap<int, UIAction*>          m_pool;
     647    /** Holds the map of action groups.
     648      * @note Only menu actions can have action groups. */
     649    QMap<int, QActionGroup*>      m_groupPool;
    643650    /** Holds the map of validation handlers. */
    644651    QMap<int, PointerToFunction>  m_menuUpdateHandlers;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette