ActionContainer Class

class Core::ActionContainer

The ActionContainer class represents a menu or menu bar in Qt Creator. More...

Header: #include <coreplugin/actionmanager/actioncontainer.h>

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.