HistoryCompleter: Correct reaction for Key_Down

Change-Id: I9b0d56b6f615f567391349404250d05b5c0b9113
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Orgad Shaneh
2012-08-26 11:40:32 +03:00
committed by hjk
parent edf4a975df
commit 4e66baa6ff

View File

@@ -180,7 +180,9 @@ HistoryCompleter::~HistoryCompleter()
bool HistoryCompleter::eventFilter(QObject *obj, QEvent *event)
{
if (event->type() == QEvent::KeyPress && static_cast<QKeyEvent *>(event)->key() == Qt::Key_Down) {
if (event->type() == QEvent::KeyPress &&
static_cast<QKeyEvent *>(event)->key() == Qt::Key_Down &&
static_cast<QLineEdit *>(widget())->text().isEmpty()) {
setCompletionPrefix(QString());
complete();
}