Commit 21e7a6ec authored by Eike Ziller's avatar Eike Ziller

Let EditorView handle mouse click (setting current view) itself

Moves the handling from SplitterOrView to EditorView.

Change-Id: I187093ff4570709bac111c4cb4cf901c971a1973
Reviewed-by: default avatarDavid Schulz <david.schulz@digia.com>
parent e4082646
......@@ -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) {
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment