本文整理汇总了C++中core::ICore::progressManager方法的典型用法代码示例。如果您正苦于以下问题:C++ ICore::progressManager方法的具体用法?C++ ICore::progressManager怎么用?C++ ICore::progressManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core::ICore
的用法示例。
在下文中一共展示了ICore::progressManager方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: extensionsInitialized
void QtTestPlugin::extensionsInitialized()
{
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
Core::ICore *core = Core::ICore::instance();
Core::ActionManager *am = core->actionManager();
m_messageOutputWindow = new TestOutputWindow();
pm->addObject(m_messageOutputWindow);
m_testResultsWindow = TestResultsWindow::instance();
connect(m_testResultsWindow, SIGNAL(stopTest()), this, SLOT(stopTesting()));
connect(m_testResultsWindow, SIGNAL(retryFailedTests(QStringList)),
this, SLOT(retryTests(QStringList)));
connect(TestExecuter::instance(), SIGNAL(testStarted()),
m_testResultsWindow, SLOT(onTestStarted()));
connect(TestExecuter::instance(), SIGNAL(testStop()),
m_testResultsWindow, SLOT(onTestStopped()));
connect(TestExecuter::instance(), SIGNAL(testFinished()),
m_testResultsWindow, SLOT(onTestFinished()));
pm->addObject(m_testResultsWindow);
connect(testResultsPane(), SIGNAL(defectSelected(TestCaseRec)),
this, SLOT(onDefectSelected(TestCaseRec)));
// Add context menu to CPP editor
Core::ActionContainer *mcontext = am->actionContainer(CppEditor::Constants::M_CONTEXT);
m_contextMenu->init(mcontext->menu(), 2, this);
// Add context menu to JS editor
mcontext = am->actionContainer(QmlJSEditor::Constants::M_CONTEXT);
m_contextMenu->init(mcontext->menu(), 2, this);
// Add a Test menu to the menu bar
Core::ActionContainer* ac = am->createMenu("QtTestPlugin.TestMenu");
ac->menu()->setTitle(tr("&Test"));
m_contextMenu->init(ac->menu(), 0, 0);
// Insert the "Test" menu between "Window" and "Help".
QMenu *windowMenu = am->actionContainer(Core::Constants::M_TOOLS)->menu();
QMenuBar *menuBar = am->actionContainer(Core::Constants::MENU_BAR)->menuBar();
menuBar->insertMenu(windowMenu->menuAction(), ac->menu());
ProjectExplorer::ProjectExplorerPlugin *explorer =
ProjectExplorer::ProjectExplorerPlugin::instance();
connect(explorer->session(), SIGNAL(startupProjectChanged(ProjectExplorer::Project*)),
this, SLOT(onStartupProjectChanged(ProjectExplorer::Project *)));
connect(core->progressManager(), SIGNAL(allTasksFinished(QString)),
this, SLOT(onAllTasksFinished(QString)));
connect(explorer->session(), SIGNAL(aboutToRemoveProject(ProjectExplorer::Project *)),
this, SLOT(onProjectRemoved(ProjectExplorer::Project *)));
m_contextMenu->init(0, 3, this);
}
示例2: initialize
//.........这里部分代码省略.........
wizardParameters.setId(QLatin1String("B.Source"));
addAutoReleasedObject(new CppFileWizard(wizardParameters, Source, core));
wizardParameters.setDescription(tr("Creates a C++ header file that you can add to a C++ project."));
wizardParameters.setDisplayName(tr("C++ Header File"));
wizardParameters.setId(QLatin1String("C.Header"));
addAutoReleasedObject(new CppFileWizard(wizardParameters, Header, core));
Core::Context context(CppEditor::Constants::C_CPPEDITOR);
Core::ActionManager *am = core->actionManager();
Core::ActionContainer *contextMenu= am->createMenu(CppEditor::Constants::M_CONTEXT);
Core::Command *cmd;
Core::ActionContainer *cppToolsMenu = am->actionContainer(Core::Id(CppTools::Constants::M_TOOLS_CPP));
QAction *jumpToDefinition = new QAction(tr("Follow Symbol Under Cursor"), this);
cmd = am->registerAction(jumpToDefinition,
Constants::JUMP_TO_DEFINITION, context, true);
cmd->setDefaultKeySequence(QKeySequence(Qt::Key_F2));
connect(jumpToDefinition, SIGNAL(triggered()),
this, SLOT(jumpToDefinition()));
contextMenu->addAction(cmd);
cppToolsMenu->addAction(cmd);
QAction *switchDeclarationDefinition = new QAction(tr("Switch Between Method Declaration/Definition"), this);
cmd = am->registerAction(switchDeclarationDefinition,
Constants::SWITCH_DECLARATION_DEFINITION, context, true);
cmd->setDefaultKeySequence(QKeySequence("Shift+F2"));
connect(switchDeclarationDefinition, SIGNAL(triggered()),
this, SLOT(switchDeclarationDefinition()));
contextMenu->addAction(cmd);
cppToolsMenu->addAction(cmd);
m_findUsagesAction = new QAction(tr("Find Usages"), this);
cmd = am->registerAction(m_findUsagesAction, Constants::FIND_USAGES, context);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+U")));
connect(m_findUsagesAction, SIGNAL(triggered()), this, SLOT(findUsages()));
contextMenu->addAction(cmd);
cppToolsMenu->addAction(cmd);
m_openTypeHierarchyAction = new QAction(tr("Open Type Hierarchy"), this);
cmd = am->registerAction(m_openTypeHierarchyAction, Constants::OPEN_TYPE_HIERARCHY, context);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+T")));
connect(m_openTypeHierarchyAction, SIGNAL(triggered()), this, SLOT(openTypeHierarchy()));
contextMenu->addAction(cmd);
cppToolsMenu->addAction(cmd);
// Refactoring sub-menu
Core::Context globalContext(Core::Constants::C_GLOBAL);
Core::Command *sep = createSeparator(am, this, globalContext,
Constants::SEPARATOR2);
sep->action()->setObjectName(Constants::M_REFACTORING_MENU_INSERTION_POINT);
contextMenu->addAction(sep);
contextMenu->addAction(createSeparator(am, this, globalContext,
Constants::SEPARATOR3));
m_renameSymbolUnderCursorAction = new QAction(tr("Rename Symbol Under Cursor"),
this);
cmd = am->registerAction(m_renameSymbolUnderCursorAction,
Constants::RENAME_SYMBOL_UNDER_CURSOR,
context);
cmd->setDefaultKeySequence(QKeySequence("CTRL+SHIFT+R"));
connect(m_renameSymbolUnderCursorAction, SIGNAL(triggered()),
this, SLOT(renameSymbolUnderCursor()));
cppToolsMenu->addAction(cmd);
// Update context in global context
cppToolsMenu->addAction(createSeparator(am, this, globalContext, CppEditor::Constants::SEPARATOR4));
m_updateCodeModelAction = new QAction(tr("Update Code Model"), this);
cmd = am->registerAction(m_updateCodeModelAction, Core::Id(Constants::UPDATE_CODEMODEL), globalContext);
CPlusPlus::CppModelManagerInterface *cppModelManager = CPlusPlus::CppModelManagerInterface::instance();
connect(m_updateCodeModelAction, SIGNAL(triggered()), cppModelManager, SLOT(updateModifiedSourceFiles()));
cppToolsMenu->addAction(cmd);
m_actionHandler = new TextEditor::TextEditorActionHandler(CppEditor::Constants::C_CPPEDITOR,
TextEditor::TextEditorActionHandler::Format
| TextEditor::TextEditorActionHandler::UnCommentSelection
| TextEditor::TextEditorActionHandler::UnCollapseAll);
m_actionHandler->initializeActions();
contextMenu->addAction(createSeparator(am, this, context, CppEditor::Constants::SEPARATOR));
cmd = am->command(TextEditor::Constants::AUTO_INDENT_SELECTION);
contextMenu->addAction(cmd);
cmd = am->command(TextEditor::Constants::UN_COMMENT_SELECTION);
contextMenu->addAction(cmd);
connect(core->progressManager(), SIGNAL(taskStarted(QString)),
this, SLOT(onTaskStarted(QString)));
connect(core->progressManager(), SIGNAL(allTasksFinished(QString)),
this, SLOT(onAllTasksFinished(QString)));
connect(core->editorManager(), SIGNAL(currentEditorChanged(Core::IEditor*)), SLOT(currentEditorChanged(Core::IEditor*)));
readSettings();
return true;
}