diff options
author | Daniel Molkentin <daniel.molkentin@nokia.com> | 2009-09-11 11:19:33 +0200 |
---|---|---|
committer | Daniel Molkentin <daniel.molkentin@nokia.com> | 2009-09-11 11:20:18 +0200 |
commit | 7f54f9d339a195717cdbec7f17b20110f1680175 (patch) | |
tree | f4c8e6f979953c3cca6e2476623e815d9ab9be09 /src/plugins/texteditor/completionwidget.cpp | |
parent | 06900dc4750b5b4669b104c05f42052fa23b0a9d (diff) | |
download | qt-creator-7f54f9d339a195717cdbec7f17b20110f1680175.tar.gz |
Wrap completion box list when navigating with up/down arrow keys.
Reviewed-by: Thorbjorn Lindeijer
Diffstat (limited to 'src/plugins/texteditor/completionwidget.cpp')
-rw-r--r-- | src/plugins/texteditor/completionwidget.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/texteditor/completionwidget.cpp b/src/plugins/texteditor/completionwidget.cpp index 91b05cd7a2..c656500f07 100644 --- a/src/plugins/texteditor/completionwidget.cpp +++ b/src/plugins/texteditor/completionwidget.cpp @@ -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: |