Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-65508

Cursor positioning isn't accurate in wrapped bidi text

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.10
    • Fix Version/s: None
    • Component/s: GUI: Text handling
    • Labels:
      None
    • Environment:
      ArchLinux 64bit

      Description

      When using a QTextEdit or a QTextLayout to render some bidi text, the cusror position isn't accurate in some conditions.
      Taking a text that starts with an English letter, and continues with Arabic words:
      t تجربة تجربة تجربة تجربة تجربة تجربة تجربة تجربة تجربة تجربة تجربة تجربة تجربة تجربة تجربة تجربة تجربة تجربة
      or the opposite:
      ت test test test test test test test test test test test test test test test test test test
      You will notice that (in QTextEdit, word wrapping is on) the cursor in the first lines is misplaced and appears on the letter, and dragging the cusror to left or right will select a different letter than desired. While in the last wrapped line the cursor is correctly placed.

      Attached several pictures showing wrong positioning of cursor.

      The same happens with QTextLayout which other advanced text editors use for layouting text (Kate for example)

        Attachments

        1. LTR Direction - right.png
          LTR Direction - right.png
          34 kB
        2. LTR Direction - wrong.png
          LTR Direction - wrong.png
          34 kB
        3. RTL Direction - right.png
          RTL Direction - right.png
          29 kB
        4. RTL Direction - wrong.png
          RTL Direction - wrong.png
          29 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              esabraha Eskil Abrahamsen Blomfeldt
              Reporter:
              safa alfulaij Safa Alfulaij
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes