forked from qt-creator/qt-creator
Don't wrap around the completion list when auto-repeating
It can be a bit disturbing if the list suddenly jumps when you don't release the down or up key in time. Done with mae.
This commit is contained in:
@@ -166,14 +166,16 @@ bool CompletionWidget::event(QEvent *e)
|
|||||||
closeList(currentIndex());
|
closeList(currentIndex());
|
||||||
return true;
|
return true;
|
||||||
case Qt::Key_Up:
|
case Qt::Key_Up:
|
||||||
if (currentIndex().row() == 0) {
|
if (!ke->isAutoRepeat()
|
||||||
|
&& currentIndex().row() == 0) {
|
||||||
setCurrentIndex(model()->index(model()->rowCount()-1, 0));
|
setCurrentIndex(model()->index(model()->rowCount()-1, 0));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
forwardKeys = false;
|
forwardKeys = false;
|
||||||
break;
|
break;
|
||||||
case Qt::Key_Down:
|
case Qt::Key_Down:
|
||||||
if (currentIndex().row() == model()->rowCount()-1) {
|
if (!ke->isAutoRepeat()
|
||||||
|
&& currentIndex().row() == model()->rowCount()-1) {
|
||||||
setCurrentIndex(model()->index(0, 0));
|
setCurrentIndex(model()->index(0, 0));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user