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

Mixed bidirectional multiline text in text edits corrupts selection



    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.11.1
    • Fix Version/s: None
    • Component/s: GUI: Text handling
    • Labels:
    • Platform/s:
      Linux/X11, Windows


      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.


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



            esabraha Eskil Abrahamsen Blomfeldt
            safa alfulaij Safa Alfulaij
            0 Vote for this issue
            1 Start watching this issue



                Gerrit Reviews

                There are no open Gerrit changes