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

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)
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::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] Core::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] Core::ModeManager *ModeManager::instance()

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

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.