Commit dddb965f authored by con's avatar con
Browse files

Locator text was no longer selected when using shortcut.


Reviewed-by: default avatardt <qtc-committer@nokia.com>
parent 2d84ccf5
......@@ -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);
......
......@@ -76,7 +76,6 @@ private:
bool eventFilter(QObject *obj, QEvent *event);
void showEvent(QShowEvent *e);
void focusInEvent(QFocusEvent *e);
bool isShowingTypeHereMessage() const;
void showCompletionList();
......
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