VirtualBox

Changeset 52555 in vbox


Ignore:
Timestamp:
Sep 1, 2014 4:29:03 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
95816
Message:

FE/Qt: Mac OS X: Runtime UI: Extend UIActionPool API with possibility to mark menus as consumable/consumed.

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

Legend:

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

    r52477 r52555  
    5959UIMenu::UIMenu()
    6060    : m_fShowToolTip(false)
     61#ifdef Q_WS_MAC
     62    , m_fConsumable(false)
     63    , m_fConsumed(false)
     64#endif /* Q_WS_MAC */
    6165{
    6266}
     
    97101     * It will be set explicitly later. */
    98102    setMenuRole(QAction::NoRole);
     103}
     104
     105UIMenu* UIAction::menu() const
     106{
     107    return qobject_cast<UIMenu*>(QAction::menu());
    99108}
    100109
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h

    r52470 r52555  
    8080
    8181
    82 /** QMenu extension
    83   * allowing to show tool-tips. */
     82/** QMenu extension. */
    8483class UIMenu : public QMenu
    8584{
     
    9493    void setShowToolTip(bool fShowToolTips) { m_fShowToolTip = fShowToolTips; }
    9594
     95#ifdef Q_WS_MAC
     96    /** Mac OS X: Returns whether this menu is consumable by the menu-bar. */
     97    bool isConsumable() const { return m_fConsumable; }
     98    /** Mac OS X: Defines whether this menu is @a fConsumable by the menu-bar. */
     99    void setConsumable(bool fConsumable) { m_fConsumable = fConsumable; }
     100
     101    /** Mac OS X: Returns whether this menu is consumed by the menu-bar. */
     102    bool isConsumed() const { return m_fConsumed; }
     103    /** Mac OS X: Defines whether this menu is @a fConsumed by the menu-bar. */
     104    void setConsumed(bool fConsumed) { m_fConsumed = fConsumed; }
     105#endif /* Q_WS_MAC */
     106
    96107protected:
    97108
     
    103114    /** Holds whether tool-tip should be shown. */
    104115    bool m_fShowToolTip;
     116
     117#ifdef Q_WS_MAC
     118    /** Mac OS X: Holds whether this menu can be consumed by the menu-bar. */
     119    bool m_fConsumable;
     120    /** Mac OS X: Holds whether this menu is consumed by the menu-bar. */
     121    bool m_fConsumed;
     122#endif /* Q_WS_MAC */
    105123};
    106124
     
    115133    /** Returns action type. */
    116134    UIActionType type() const { return m_type; }
     135
     136    /** Returns menu contained by this action. */
     137    UIMenu* menu() const;
    117138
    118139    /** Returns action-pool this action belongs to. */
Note: See TracChangeset for help on using the changeset viewer.

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