QmlConsole: Fixes navigation issue with right arrow key

When the cursor is just before the first element, the right key
did not work.

Change-Id: I0a00b0593d4a6450311253cc021c70a64f75b456
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Aurindam Jana
2013-03-05 10:57:37 +01:00
parent 23fd6730fa
commit 078fbba429

View File

@@ -135,7 +135,7 @@ void QmlConsoleEdit::keyPressEvent(QKeyEvent *e)
// Right: Moves the cursor one character to the right. // Right: Moves the cursor one character to the right.
case Qt::Key_Right: case Qt::Key_Right:
if ( !(e->modifiers() & Qt::ControlModifier) if ( !(e->modifiers() & Qt::ControlModifier)
&& textCursor().position() <= m_startOfEditableArea) { && textCursor().position() < m_startOfEditableArea) {
QTextCursor c(textCursor()); QTextCursor c(textCursor());
c.setPosition(m_startOfEditableArea); c.setPosition(m_startOfEditableArea);
setTextCursor(c); setTextCursor(c);