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

TextEdit: Richtext to Standard text conversion problem

    XMLWordPrintable

Details

    • All

    Description

      I have noticed that when I convert Richtext to normal string in TextEdit using getText(int start, int end) method, Carriage Returns are not converted properly to a new line character, like "\r\n". Hence the output plaintext cannot be processed properly. I am attaching a simple QML code and if you run the code and press enter inside the textedit, you might notice a "?" in the console depicting a non-printable character

       

      To circumvent this on the QML side, I had to convert the obtained plaintext to HEX and replace the Carriage return characters.

      Another approach to circumvent this would be to use QTextDocument to convert HTML to plaintext.

      But, in all the getText(int start, int end) cannot be used directly to obtain the same result with new line characters

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            chilarai chilarai mushahary
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes