forked from qt-creator/qt-creator
Core: Adapt documentation to recent refactoring.
ProgressManager and ActionManager are no longer retrieved via ICore, and most accesses do not go via the instance anymore. Change-Id: Ib0c3033270051aaadfb25e0b2b0eaf7bdec63a1d Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
committed by
Eike Ziller
parent
60710f6c05
commit
6448d26ad7
@@ -41,19 +41,17 @@ bool ExamplePlugin::initialize(const QStringList &arguments, QString *errorStrin
|
||||
Q_UNUSED(errorString)
|
||||
|
||||
//! [add action]
|
||||
Core::ActionManager *am = Core::ICore::instance()->actionManager();
|
||||
|
||||
QAction *action = new QAction(tr("Example action"), this);
|
||||
Core::Command *cmd = am->registerAction(action, Constants::ACTION_ID,
|
||||
Core::Command *cmd = Core::ActionManager::registerAction(action, Constants::ACTION_ID,
|
||||
Core::Context(Core::Constants::C_GLOBAL));
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+Meta+A")));
|
||||
connect(action, SIGNAL(triggered()), this, SLOT(triggerAction()));
|
||||
//! [add action]
|
||||
//! [add menu]
|
||||
Core::ActionContainer *menu = am->createMenu(Constants::MENU_ID);
|
||||
Core::ActionContainer *menu = Core::ActionManager::createMenu(Constants::MENU_ID);
|
||||
menu->menu()->setTitle(tr("Example"));
|
||||
menu->addAction(cmd);
|
||||
am->actionContainer(Core::Constants::M_TOOLS)->addMenu(menu);
|
||||
Core::ActionManager::actionContainer(Core::Constants::M_TOOLS)->addMenu(menu);
|
||||
//! [add menu]
|
||||
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user