summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qlinecontrol.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/qlinecontrol.cpp')
-rw-r--r--src/gui/widgets/qlinecontrol.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index 289faa9b02..eb4e142328 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -1585,6 +1585,7 @@ void QLineControl::processKeyEvent(QKeyEvent* event)
}
bool unknown = false;
+ bool visual = cursorMoveStyle() == QTextCursor::Visual;
if (false) {
}
@@ -1649,11 +1650,11 @@ void QLineControl::processKeyEvent(QKeyEvent* event)
#endif
moveCursor(selectionEnd(), false);
} else {
- cursorForward(0, layoutDirection() == Qt::LeftToRight ? 1 : -1);
+ cursorForward(0, visual ? 1 : (layoutDirection() == Qt::LeftToRight ? 1 : -1));
}
}
else if (event == QKeySequence::SelectNextChar) {
- cursorForward(1, layoutDirection() == Qt::LeftToRight ? 1 : -1);
+ cursorForward(1, visual ? 1 : (layoutDirection() == Qt::LeftToRight ? 1 : -1));
}
else if (event == QKeySequence::MoveToPreviousChar) {
#if !defined(Q_WS_WIN) || defined(QT_NO_COMPLETER)
@@ -1664,11 +1665,11 @@ void QLineControl::processKeyEvent(QKeyEvent* event)
#endif
moveCursor(selectionStart(), false);
} else {
- cursorForward(0, layoutDirection() == Qt::LeftToRight ? -1 : 1);
+ cursorForward(0, visual ? -1 : (layoutDirection() == Qt::LeftToRight ? -1 : 1));
}
}
else if (event == QKeySequence::SelectPreviousChar) {
- cursorForward(1, layoutDirection() == Qt::LeftToRight ? -1 : 1);
+ cursorForward(1, visual ? -1 : (layoutDirection() == Qt::LeftToRight ? -1 : 1));
}
else if (event == QKeySequence::MoveToNextWord) {
if (echoMode() == QLineEdit::Normal)