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

Mixed bidirectional multiline text in text edits corrupts selection

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.11.1
    • GUI: Text handling
    • None
    • Linux/X11, Windows

    Description

      When a text edit (ex. QTextEdit or TextEdit) contains mixed LTR and RTL multiline text, the selection get courrputed for any text that wraps and it's direction is not the same as the base direction.

      For example, supposing capital letters are Arabic text:

      This is ARABIC text THAT
      WRAPS HERE reaching
      to the THIRD LINE but
      stops wrapping HERE.

      Base direction: LTR.
      Arabic text that wraps: "THAT WRAPS HERE" -> Issue with selection
      Arabic text that doesn't wrap: "THIRD LINE" -> No issues with selection

      I have attached an old UI file that I created to test several cases, thinking that the issue happens with the lines except the last one, and the text (direction = base direction) in the first line, but that wasn't general enough. More invistigation leaded to what I wrote above.

      I have attached also a video for the selection problem. Sorry that the cursor doesn't show.
      The problem actually is that when you click somewhere, the I cursor is rendered in the letter itself, or offseted from the correct location. Clicking and moving the mouse will select strange letters, depending on the font and how complex it is.

      This issue affects Kate as well, which uses QTextLayout.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            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