diff --git a/src/plugins/quickopen/quickopentoolwindow.cpp b/src/plugins/quickopen/quickopentoolwindow.cpp
index 139559bee34dd9fdd40ab2631b6fc828710a30f3..f6d9ae1a90336ff2cbc3acb6d30c2ce82af1c350 100644
--- a/src/plugins/quickopen/quickopentoolwindow.cpp
+++ b/src/plugins/quickopen/quickopentoolwindow.cpp
@@ -345,6 +345,8 @@ bool QuickOpenToolWindow::eventFilter(QObject *obj, QEvent *event)
     } else if (obj == m_fileLineEdit && event->type() == QEvent::FocusOut) {
         m_completionList->hide();
     } else if (obj == m_fileLineEdit && event->type() == QEvent::FocusIn) {
+        if (static_cast<QFocusEvent*>(event)->reason() != Qt::MouseFocusReason)
+            m_fileLineEdit->selectAll();
         updateCompletionList(m_fileLineEdit->typedText());
         showCompletionList();
     } else if (obj == this && event->type() == QEvent::ShortcutOverride) {
@@ -470,15 +472,6 @@ void QuickOpenToolWindow::filterSelected()
     m_fileLineEdit->setFocus();
 }
 
-void QuickOpenToolWindow::focusInEvent(QFocusEvent *e)
-{
-    m_fileLineEdit->setFocus(e->reason());
-    if (e->reason() != Qt::MouseFocusReason) {
-        m_fileLineEdit->selectAll();
-    }
-    QWidget::focusInEvent(e);
-}
-
 void QuickOpenToolWindow::showEvent(QShowEvent *event)
 {
     QWidget::showEvent(event);
diff --git a/src/plugins/quickopen/quickopentoolwindow.h b/src/plugins/quickopen/quickopentoolwindow.h
index aa898fd5eea1dea4feb08db4816d2fa5e75d99c1..50b5b920f06a9691ee5ebca53a5d7aafa6165e83 100644
--- a/src/plugins/quickopen/quickopentoolwindow.h
+++ b/src/plugins/quickopen/quickopentoolwindow.h
@@ -76,7 +76,6 @@ private:
     bool eventFilter(QObject *obj, QEvent *event);
 
     void showEvent(QShowEvent *e);
-    void focusInEvent(QFocusEvent *e);
 
     bool isShowingTypeHereMessage() const;
     void showCompletionList();