Utils: Don't filter HistoryLineEdit popup

... and make the list accessible on <Down> even if
the content of the line edit is not empty.

Change-Id: Ib9fdd379dd9c96e2e0ddf58d9f6e9ec3d4374527
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
hjk
2015-03-27 13:52:10 +01:00
parent 8fbe192124
commit f08af0d6db
2 changed files with 2 additions and 3 deletions

View File

@@ -63,12 +63,10 @@ void CompletingLineEdit::keyPressEvent(QKeyEvent *e)
{ {
if (e->key() == Qt::Key_Down && !e->modifiers()) { if (e->key() == Qt::Key_Down && !e->modifiers()) {
if (QCompleter *comp = completer()) { if (QCompleter *comp = completer()) {
if (text().isEmpty() && !comp->popup()->isVisible()) { if (!comp->popup()->isVisible())
comp->setCompletionPrefix(QString());
comp->complete(); comp->complete();
} }
} }
}
return QLineEdit::keyPressEvent(e); return QLineEdit::keyPressEvent(e);
} }

View File

@@ -174,6 +174,7 @@ HistoryCompleter::HistoryCompleter(const QString &historyKey, QObject *parent)
{ {
QTC_ASSERT(!historyKey.isEmpty(), return); QTC_ASSERT(!historyKey.isEmpty(), return);
QTC_ASSERT(theSettings, return); QTC_ASSERT(theSettings, return);
setCompletionMode(QCompleter::UnfilteredPopupCompletion);
d->historyKey = QLatin1String("CompleterHistory/") + historyKey; d->historyKey = QLatin1String("CompleterHistory/") + historyKey;
d->list = theSettings->value(d->historyKey).toStringList(); d->list = theSettings->value(d->historyKey).toStringList();