Locator text was no longer selected when using shortcut.

Reviewed-by: dt <qtc-committer@nokia.com>
This commit is contained in:
con
2009-06-03 15:31:30 +02:00
parent 2d84ccf528
commit dddb965f83
2 changed files with 2 additions and 10 deletions

View File

@@ -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);