summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2014-09-02 09:32:25 +0200
committerhjk <hjk121@nokiamail.com>2014-09-02 11:42:07 +0200
commit6109ec905f169d28c47a21284852e3cb693f3b35 (patch)
tree29d51543dfed132ef29da00c08b49342393cbd3b /src/plugins
parent70d436a610a86d480e1e894635827001ba5d5779 (diff)
downloadqt-creator-6109ec905f169d28c47a21284852e3cb693f3b35.tar.gz
TextEditor: Introduce a *Widget::activateEditor signal
For communication with the EditorManager without explicitly using the editor() member. Change-Id: I89882201924682111365b28804aed28c967bd442 Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/cppeditor/cppeditoroutline.cpp2
-rw-r--r--src/plugins/texteditor/basetexteditor.cpp3
-rw-r--r--src/plugins/texteditor/basetexteditor.h1
3 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/cppeditor/cppeditoroutline.cpp b/src/plugins/cppeditor/cppeditoroutline.cpp
index 51533ef003..ad28da7b84 100644
--- a/src/plugins/cppeditor/cppeditoroutline.cpp
+++ b/src/plugins/cppeditor/cppeditoroutline.cpp
@@ -256,7 +256,7 @@ void CppEditorOutline::gotoSymbolInEditor()
Core::EditorManager::cutForwardNavigationHistory();
Core::EditorManager::addCurrentPositionToNavigationHistory();
m_editorWidget->gotoLine(link.targetLine, link.targetColumn);
- Core::EditorManager::activateEditor(m_editorWidget->editor());
+ m_editorWidget->activateEditor();
}
QModelIndex CppEditorOutline::indexForPosition(int line, int column,
diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp
index 237e5973b3..08d716f626 100644
--- a/src/plugins/texteditor/basetexteditor.cpp
+++ b/src/plugins/texteditor/basetexteditor.cpp
@@ -7337,6 +7337,9 @@ BaseTextEditor *BaseTextEditorFactory::createEditorHelper(const BaseTextDocument
editor->markTooltipRequested(editor, globalPos, line);
});
+ connect(widget, &BaseTextEditorWidget::activateEditor,
+ [editor]() { Core::EditorManager::activateEditor(editor); });
+
widget->finalizeInitialization();
editor->finalizeInitialization();
diff --git a/src/plugins/texteditor/basetexteditor.h b/src/plugins/texteditor/basetexteditor.h
index 9f49dff411..b21e05b3fd 100644
--- a/src/plugins/texteditor/basetexteditor.h
+++ b/src/plugins/texteditor/basetexteditor.h
@@ -608,6 +608,7 @@ signals:
void tooltipOverrideRequested(const QPoint &globalPos, int position, bool *handled);
void tooltipRequested(const QPoint &globalPos, int position);
void markTooltipRequested(const QPoint &globalPos, int line);
+ void activateEditor();
protected slots:
virtual void slotCursorPositionChanged(); // Used in VcsBase