Wrap completion box list when navigating with up/down arrow keys.

Reviewed-by: Thorbjorn Lindeijer
This commit is contained in:
Daniel Molkentin
2009-09-11 11:19:33 +02:00
parent 06900dc475
commit 7f54f9d339

View File

@@ -156,7 +156,17 @@ bool CompletionWidget::event(QEvent *e)
closeList(currentIndex());
return true;
case Qt::Key_Up:
if (currentIndex().row() == 0) {
setCurrentIndex(model()->index(model()->rowCount()-1, 0));
return true;
}
forwardKeys = false;
break;
case Qt::Key_Down:
if (currentIndex().row() == model()->rowCount()-1) {
setCurrentIndex(model()->index(0, 0));
return true;
}
case Qt::Key_Enter:
case Qt::Key_PageDown:
case Qt::Key_PageUp: