summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcon <qtc-committer@nokia.com>2009-06-03 17:39:08 +0200
committercon <qtc-committer@nokia.com>2009-06-03 17:41:25 +0200
commit240a6ec55cb7467af712bdade804a79d7a21ba48 (patch)
tree3128712b7790a4570d3d7e24c8490be88fe419c2 /src
parent4505d92be54a78dc2ca349e47ebee5b0199a65d5 (diff)
downloadqt-creator-240a6ec55cb7467af712bdade804a79d7a21ba48.tar.gz
Fixes locator's show method in case the filter already has focus.
Was making the "f" filter unusable, because the popup was hidden when selecting a directory. Reviewed-by: dt <qtc-committer@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/quickopen/quickopentoolwindow.cpp15
-rw-r--r--src/plugins/quickopen/quickopentoolwindow.h2
2 files changed, 10 insertions, 7 deletions
diff --git a/src/plugins/quickopen/quickopentoolwindow.cpp b/src/plugins/quickopen/quickopentoolwindow.cpp
index f6d9ae1a90..9d7ada56be 100644
--- a/src/plugins/quickopen/quickopentoolwindow.cpp
+++ b/src/plugins/quickopen/quickopentoolwindow.cpp
@@ -296,7 +296,7 @@ QuickOpenToolWindow::QuickOpenToolWindow(QuickOpenPlugin *qop) :
connect(m_refreshAction, SIGNAL(triggered()), m_quickOpenPlugin, SLOT(refresh()));
connect(m_configureAction, SIGNAL(triggered()), this, SLOT(showConfigureDialog()));
connect(m_fileLineEdit, SIGNAL(textEdited(const QString&)),
- this, SLOT(textEdited(const QString&)));
+ this, SLOT(showPopup()));
connect(m_completionList, SIGNAL(activated(QModelIndex)),
this, SLOT(acceptCurrentEntry()));
}
@@ -347,8 +347,7 @@ bool QuickOpenToolWindow::eventFilter(QObject *obj, QEvent *event)
} 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();
+ showPopup();
} else if (obj == this && event->type() == QEvent::ShortcutOverride) {
QKeyEvent *ke = static_cast<QKeyEvent *>(event);
if (ke->key() == Qt::Key_Escape && !ke->modifiers()) {
@@ -369,9 +368,9 @@ void QuickOpenToolWindow::showCompletionList()
m_completionList->show();
}
-void QuickOpenToolWindow::textEdited(const QString &text)
+void QuickOpenToolWindow::showPopup()
{
- updateCompletionList(text);
+ updateCompletionList(m_fileLineEdit->typedText());
showCompletionList();
}
@@ -440,7 +439,11 @@ void QuickOpenToolWindow::show(const QString &text, int selectionStart, int sele
{
m_fileLineEdit->hideHintText();
m_fileLineEdit->setText(text);
- setFocus();
+ if (!m_fileLineEdit->hasFocus())
+ m_fileLineEdit->setFocus();
+ else
+ showPopup();
+
if (selectionStart >= 0)
m_fileLineEdit->setSelection(selectionStart, selectionLength);
else
diff --git a/src/plugins/quickopen/quickopentoolwindow.h b/src/plugins/quickopen/quickopentoolwindow.h
index 50b5b920f0..2a8dc03a9e 100644
--- a/src/plugins/quickopen/quickopentoolwindow.h
+++ b/src/plugins/quickopen/quickopentoolwindow.h
@@ -67,7 +67,7 @@ public:
void show(const QString &text, int selectionStart = -1, int selectionLength = 0);
private slots:
- void textEdited(const QString &text);
+ void showPopup();
void acceptCurrentEntry();
void filterSelected();
void showConfigureDialog();