ActionContainer Class
class Core::ActionContainerThe ActionContainer class represents a menu or menu bar in Qt Creator. More...
Header: | #include <coreplugin/actionmanager/actioncontainer.h> |
Inherits: | QObject |
Public Types
enum | OnAllDisabledBehavior { Disable, Hide, Show } |
Detailed Description
You don't create instances of this class directly, but instead use the ActionManager::createMenu(), ActionManager::createMenuBar() and ActionManager::createTouchBar() functions. Retrieve existing action containers for an ID with ActionManager::actionContainer().
Within a menu or menu bar you can group menus and items together by defining groups (the order of the groups is defined by the order of the ActionContainer::appendGroup() calls), and adding menus or actions to these groups. If no custom groups are defined, an action container has three default groups Core::Constants::G_DEFAULT_ONE
, Core::Constants::G_DEFAULT_TWO
and Core::Constants::G_DEFAULT_THREE
.
You can specify whether the menu represented by this action container should be automatically disabled or hidden whenever it only contains disabled items and submenus by setting the corresponding setOnAllDisabledBehavior(). The default is ActionContainer::Disable for menus, and ActionContainer::Show for menu bars.
Member Type Documentation
enum ActionContainer::OnAllDisabledBehavior
Defines what happens when the represented menu is empty or contains only disabled or invisible items.
Constant | Value | Description |
---|---|---|
Core::ActionContainer::Disable | 0 | The menu will be visible but disabled. |
Core::ActionContainer::Hide | 1 | The menu will not be visible until the state of the subitems changes. |
Core::ActionContainer::Show | 2 | The menu will still be visible and active. |