diff options
| -rw-r--r-- | src/kitemviews/private/kitemlistroleeditor.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/kitemviews/private/kitemlistroleeditor.cpp b/src/kitemviews/private/kitemlistroleeditor.cpp index 9f20afea2..0a48f1ba0 100644 --- a/src/kitemviews/private/kitemlistroleeditor.cpp +++ b/src/kitemviews/private/kitemlistroleeditor.cpp @@ -93,6 +93,22 @@ void KItemListRoleEditor::keyPressEvent(QKeyEvent* event) emitRoleEditingFinished(); event->accept(); return; + case Qt::Key_Left: + case Qt::Key_Right: { + QTextCursor cursor = textCursor(); + if (event->modifiers() == Qt::NoModifier && cursor.hasSelection()) { + if (event->key() == Qt::Key_Left) { + cursor.setPosition(cursor.selectionStart()); + } else { + cursor.setPosition(cursor.selectionEnd()); + } + cursor.clearSelection(); + setTextCursor(cursor); + event->accept(); + return; + } + break; + } default: break; } |
