Core::IEditor *CppEditorFactory::createEditor(QWidget *parent) { CPPEditorWidget *editor = new CPPEditorWidget(parent); editor->setRevisionsVisible(true); m_owner->initializeEditor(editor); return editor->editor(); }
void CppHoverHandler::identifyMatch(TextEditor::ITextEditor *editor, int pos) { CPPEditorWidget *cppEditor = qobject_cast<CPPEditorWidget *>(editor->widget()); if (!cppEditor) return; if (!cppEditor->extraSelectionTooltip(pos).isEmpty()) { setToolTip(cppEditor->extraSelectionTooltip(pos)); } else { QTextCursor tc(cppEditor->document()); tc.setPosition(pos); CppElementEvaluator evaluator(cppEditor); evaluator.setTextCursor(tc); evaluator.execute(); if (evaluator.hasDiagnosis()) { setToolTip(evaluator.diagnosis()); setIsDiagnosticTooltip(true); } if (evaluator.identifiedCppElement()) { const QSharedPointer<CppElement> &cppElement = evaluator.cppElement(); if (!isDiagnosticTooltip()) setToolTip(cppElement->tooltip()); foreach (const QString &helpId, cppElement->helpIdCandidates()) { if (!Core::HelpManager::instance()->linksForIdentifier(helpId).isEmpty()) { setLastHelpItemIdentified(TextEditor::HelpItem(helpId, cppElement->helpMark(), cppElement->helpCategory())); break; } } } } }
void CppPlugin::findUsages() { Core::EditorManager *em = Core::EditorManager::instance(); CPPEditorWidget *editor = qobject_cast<CPPEditorWidget*>(em->currentEditor()->widget()); if (editor) editor->findUsages(); }
void CppPlugin::renameSymbolUnderCursor() { Core::EditorManager *em = Core::EditorManager::instance(); CPPEditorWidget *editor = qobject_cast<CPPEditorWidget*>(em->currentEditor()->widget()); if (editor) editor->renameSymbolUnderCursor(); }
void CppPlugin::jumpToDefinition() { Core::EditorManager *em = Core::EditorManager::instance(); CPPEditorWidget *editor = qobject_cast<CPPEditorWidget*>(em->currentEditor()->widget()); if (editor) editor->jumpToDefinition(); }
virtual void perform() { CPPEditorWidget *editor = assistInterface()->editor(); QSharedPointer<FunctionDeclDefLink> link = editor->declDefLink(); if (link != m_link) return; return editor->applyDeclDefLinkChanges(/*don't jump*/false); }
void CppPlugin::findUsages() { CPPEditorWidget *editor = qobject_cast<CPPEditorWidget*>(Core::EditorManager::currentEditor()->widget()); if (editor) editor->findUsages(); }
void CppPlugin::renameSymbolUnderCursor() { CPPEditorWidget *editor = qobject_cast<CPPEditorWidget*>(Core::EditorManager::currentEditor()->widget()); if (editor) editor->renameSymbolUnderCursor(); }
void CppPlugin::switchDeclarationDefinition() { CPPEditorWidget *editor = qobject_cast<CPPEditorWidget*>(Core::EditorManager::currentEditor()->widget()); if (editor) editor->switchDeclarationDefinition(); }