Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
5.15.3, 5.15.7
-
None
-
Ubuntu 20.04
Description
In case if concatenate text on Hebrew language with English regular text which contains letters - output will be broken.
Please take a look on video - first like just concatenation, second like "\u200f" symbol is put before RTL text starts (to fix this issue), third one just Hebrew language.
In case if there is symbols like double dot or bracket or number and no letters - text will be correctly reversed.
In case if there is only Hebrew text - text also will be correctly reversed.
In case if there is some English letter - text will be messed (please compare lines on video).
import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.15 Window { id: root width: 640 height: 480 visible: true title: qsTr("Hello World") Item { id: textItem width: 640 height: 480 readonly property string hebrewText1: "26 דק'" readonly property string hebrewText2: "25 ק\"מ" readonly property var ltrTexts: ["1", "s", "1:", "10:10 am", "()", "1p"] property int ltrTextsIndex: 0 Text { id: buggyText anchors.top: textItem.top anchors.margins: 20 text: "%1, %2, %3".arg(textItem.ltrTexts[textItem.ltrTextsIndex]).arg(textItem.hebrewText1).arg(textItem.hebrewText2) } Text { id: fixedText anchors.margins: 20 anchors.top: buggyText.bottom text: "%1, \u200f%2, %3".arg(textItem.ltrTexts[textItem.ltrTextsIndex]).arg(textItem.hebrewText1).arg(textItem.hebrewText2) } Text { id: withoutLtrText anchors.top: fixedText.bottom anchors.margins: 20 text: "%1, %2".arg(textItem.hebrewText1).arg(textItem.hebrewText2) } Button { anchors.top: withoutLtrText.bottom anchors.topMargin: 50 onClicked: { if (textItem.ltrTextsIndex < (textItem.ltrTexts.length - 1)) { textItem.ltrTextsIndex += 1; } else { textItem.ltrTextsIndex = 0; } } } } }
Attachments
Issue Links
- relates to
-
QTBUG-126867 Mixing RTL and LTR language breaks QML Text layout
- Closed