On Tuesday 30 July 2024 08:30:27 GMT-7 Turtle Creek Software wrote:
> We ran into a weird error with QTextStream.  When using it to read a text
> file, it removes all the line endings. That happens with readAll, read and
> readLine.
> 
> Getting a QString direct from a QFile via readAll works properly.
> 
> Is this expected behavior in QTextStream? It's not documented anywhere.

No, it's not.

Looking at the code, it looks like it implements the translation from CRLF to 
newlines by simple removal of the CR. It doesn't check that it's followed by 
an LF.

Is your text file using CRs alone for line breaks?

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Principal Engineer - Intel DCAI Platform & System Engineering

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to