import QtQuick 2.12 import QtQuick.Controls 2.5 import QtQuick.Window 2.12 Window { visible: true width: 640 height: 480 title: qsTr("RTL multiline cursor issue") TextEdit { id: textEdit anchors.fill: parent anchors.margins: 1 textFormat: TextEdit.RichText } Button { anchors.bottom: parent.bottom text: "Click me to reproduce" onClicked: { textEdit.text = "שששש" // "aaaa" - works good textEdit.cursorPosition = 2 textEdit.insert(textEdit.cursorPosition, '
') textEdit.forceActiveFocus() // after this is executed - if RTL text: UP arrow doesn't work for cursor moving up. (if LTR text: UP arrow works good) } } }