本页内容

Core::ModeManager Class

class Core::ModeManager

ModeManager 类负责管理模式的激活以及模式选择器工具栏中的操作。更多内容...

Header: #include <coreplugin/modemanager.h>
Inherits: QObject

信号

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

静态公共成员

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

详细说明

模式通过IMode 类实现。使用ModeManager可强制激活某种模式,或在活动模式发生变化时接收通知。

ModeManager 还管理模式选择器工具栏中可见的操作。向工具栏添加操作应非常谨慎。

成员函数文档

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

将 ID 为id 的模式设为当前模式。

另请参阅 currentMode()、currentModeId()、currentModeAboutToChange() 以及currentModeChanged()。

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

将“action ”添加到模式选择器的工具栏中。操作按priority 值从高到低排序。请非常谨慎地使用此功能。

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

返回指向当前模式的指针。

另请参阅 activateMode() 和currentModeId()。

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

在电流模式从oldMode 切换到mode 后触发。

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

返回当前模式的 ID。

另请参阅 activateMode() 和currentMode()。

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

返回该实例的指针。仅用于连接信号。

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.