forked from qt-creator/qt-creator
Locator text was no longer selected when using shortcut.
Reviewed-by: dt <qtc-committer@nokia.com>
This commit is contained in:
@@ -345,6 +345,8 @@ bool QuickOpenToolWindow::eventFilter(QObject *obj, QEvent *event)
|
|||||||
} else if (obj == m_fileLineEdit && event->type() == QEvent::FocusOut) {
|
} else if (obj == m_fileLineEdit && event->type() == QEvent::FocusOut) {
|
||||||
m_completionList->hide();
|
m_completionList->hide();
|
||||||
} else if (obj == m_fileLineEdit && event->type() == QEvent::FocusIn) {
|
} else if (obj == m_fileLineEdit && event->type() == QEvent::FocusIn) {
|
||||||
|
if (static_cast<QFocusEvent*>(event)->reason() != Qt::MouseFocusReason)
|
||||||
|
m_fileLineEdit->selectAll();
|
||||||
updateCompletionList(m_fileLineEdit->typedText());
|
updateCompletionList(m_fileLineEdit->typedText());
|
||||||
showCompletionList();
|
showCompletionList();
|
||||||
} else if (obj == this && event->type() == QEvent::ShortcutOverride) {
|
} else if (obj == this && event->type() == QEvent::ShortcutOverride) {
|
||||||
@@ -470,15 +472,6 @@ void QuickOpenToolWindow::filterSelected()
|
|||||||
m_fileLineEdit->setFocus();
|
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)
|
void QuickOpenToolWindow::showEvent(QShowEvent *event)
|
||||||
{
|
{
|
||||||
QWidget::showEvent(event);
|
QWidget::showEvent(event);
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ private:
|
|||||||
bool eventFilter(QObject *obj, QEvent *event);
|
bool eventFilter(QObject *obj, QEvent *event);
|
||||||
|
|
||||||
void showEvent(QShowEvent *e);
|
void showEvent(QShowEvent *e);
|
||||||
void focusInEvent(QFocusEvent *e);
|
|
||||||
|
|
||||||
bool isShowingTypeHereMessage() const;
|
bool isShowingTypeHereMessage() const;
|
||||||
void showCompletionList();
|
void showCompletionList();
|
||||||
|
|||||||
Reference in New Issue
Block a user