Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.0 RC2
-
None
-
QT version: 5.15.0 ( MSVC 2019)
OS: Windows 10 x86_64
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