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>
Inherits: QObject

Public Types

enum class Style { IconsAndText, IconsOnly, Hidden }

Signals

void currentModeAboutToChange(Utils::Id mode)
void currentModeChanged(Utils::Id mode, Utils::Id oldMode = {})

Static Public Members

void activateMode(Utils::Id id)
void addAction(QAction *action, int priority)
void addProjectSelector(QAction *action)
IMode *currentMode()
Utils::Id currentModeId()
void cycleModeStyle()
ModeManager *instance()
Style modeStyle()
void setFocusToCurrentMode()
void setModeStyle(Style style)

Detailed Description

\ingroupmainclasses \inmodule QtCreator

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 Type Documentation

enum class ModeManager::Style

\internal

Member Function Documentation

[static] void ModeManager::activateMode(Utils::Id id)

Makes the mode with ID id the current mode.

See also currentMode(), currentModeId(), currentModeAboutToChange(), and currentModeChanged().

[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] void ModeManager::addProjectSelector(QAction *action)

\internal

[static] IMode *ModeManager::currentMode()

Returns a pointer to the current mode.

See also activateMode() and currentModeId().

[signal] void ModeManager::currentModeAboutToChange(Utils::Id mode)

Emitted before the current mode changes to mode.

[signal] void ModeManager::currentModeChanged(Utils::Id mode, Utils::Id oldMode = {})

Emitted after the current mode changed from oldMode to mode.

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

Returns the id of the current mode.

See also activateMode() and currentMode().

[static] void ModeManager::cycleModeStyle()

\internal

[static] ModeManager *ModeManager::instance()

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

[static] Style ModeManager::modeStyle()

\internal

See also setModeStyle().

[static] void ModeManager::setFocusToCurrentMode()

\internal

[static] void ModeManager::setModeStyle(Style style)

\internal

See also modeStyle().