ModeManager Class | Extending Qt Creator Manual

- Extending Qt Creator Manual
- ModeManager
- Extending Qt Creator Manual 4.13.3

# ModeManager Class

class Core::ModeManager

The ModeManager class manages the activation of modes and the actions in the mode selector's tool bar. More...

Header: | #include <coreplugin/modemanager.h>

- List of all members, including inherited members

## Static Public Members

void | addAction(QAction *action, int priority)
Core::IMode * | currentMode()
Utils::Id | currentModeId()
Core::ModeManager * | instance()

## Detailed Description

Modes are implemented with the IMode class. Use the ModeManager to force activation of a mode, or to be notified when the active mode changed.

The ModeManager also manages the actions that are visible in the mode selector's toolbar. Adding actions to the tool bar should be done very sparingly.

## Member Function Documentation

### `[static]` void ModeManager::addAction(QAction *action, int priority)

Adds the action to the mode selector's tool bar. Actions are sorted by priority in descending order. Use this functionality very sparingly.

### `[static]` Core::IMode *ModeManager::currentMode()

Returns a pointer to the current mode.

See also activateMode() and currentModeId().

### `[static]` Utils::Id ModeManager::currentModeId()

Returns the id of the current mode.

See also activateMode() and currentMode().

### `[static]` Core::ModeManager *ModeManager::instance()

Returns the pointer to the instance. Only use for connecting to signals.