diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp index 98fc3ec020f..04f3fd91c85 100644 --- a/src/plugins/coreplugin/editormanager/editorview.cpp +++ b/src/plugins/coreplugin/editormanager/editorview.cpp @@ -185,6 +185,14 @@ void EditorView::paintEvent(QPaintEvent *) painter.drawRoundedRect(m_container->geometry().adjusted(r , r, -r, -r), r * 2, r * 2); } +void EditorView::mousePressEvent(QMouseEvent *e) +{ + if (e->button() != Qt::LeftButton) + return; + setFocus(Qt::MouseFocusReason); + ICore::editorManager()->setCurrentView(this); +} + void EditorView::addEditor(IEditor *editor) { if (m_editors.contains(editor)) @@ -493,14 +501,6 @@ SplitterOrView::~SplitterOrView() m_splitter = 0; } -void SplitterOrView::mousePressEvent(QMouseEvent *e) -{ - if (e->button() != Qt::LeftButton) - return; - setFocus(Qt::MouseFocusReason); - ICore::editorManager()->setCurrentView(view()); -} - EditorView *SplitterOrView::findFirstView() { if (m_splitter) { diff --git a/src/plugins/coreplugin/editormanager/editorview.h b/src/plugins/coreplugin/editormanager/editorview.h index 615194b11ef..74009d04f05 100644 --- a/src/plugins/coreplugin/editormanager/editorview.h +++ b/src/plugins/coreplugin/editormanager/editorview.h @@ -101,6 +101,7 @@ public: protected: void paintEvent(QPaintEvent *); + void mousePressEvent(QMouseEvent *e); private slots: void closeView(); @@ -190,9 +191,6 @@ public: void unsplitAll(); -protected: - void mousePressEvent(QMouseEvent *e); - private: void unsplitAll_helper(); SplitterOrView *findNextView_helper(SplitterOrView *view, bool *found);