diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2010-02-15 19:52:52 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2010-02-15 19:52:52 (GMT) |
commit | 6d095d54cb42f4456f09cc3c1473db9a87347f65 (patch) | |
tree | b70b2ce900c362accf3c83ca5ae37e7d15860ede /src/declarative | |
parent | 564d73b9a8ec5a5dd6f692b73625cd4c6a2f6b99 (diff) | |
download | Qt-6d095d54cb42f4456f09cc3c1473db9a87347f65.zip Qt-6d095d54cb42f4456f09cc3c1473db9a87347f65.tar.gz Qt-6d095d54cb42f4456f09cc3c1473db9a87347f65.tar.bz2 |
Fix TextInput keypad navigation
Was accidentally ignoring key movements even when an existing selection
meant that pressing right/left would do something.
Task-number: QT-2944
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicstextinput.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicstextinput.cpp b/src/declarative/graphicsitems/qmlgraphicstextinput.cpp index ea54351..6d9b7b1 100644 --- a/src/declarative/graphicsitems/qmlgraphicstextinput.cpp +++ b/src/declarative/graphicsitems/qmlgraphicstextinput.cpp @@ -646,10 +646,12 @@ void QmlGraphicsTextInput::focusChanged(bool hasFocus) void QmlGraphicsTextInput::keyPressEvent(QKeyEvent* ev) { Q_D(QmlGraphicsTextInput); - if((d->control->cursor() == 0 && ev->key() == Qt::Key_Left) + if(((d->control->cursor() == 0 && ev->key() == Qt::Key_Left) || (d->control->cursor() == d->control->text().length() - && ev->key() == Qt::Key_Right)){ + && ev->key() == Qt::Key_Right)) + && (d->lastSelectionStart == d->lastSelectionEnd)){ //ignore when moving off the end + //unless there is a selection, because then moving will do something (deselect) ev->ignore(); }else{ d->control->processKeyEvent(ev); |