[Interest] QFile::size() and QTextStream::pos()

Thiago Macieira thiago.macieira at intel.com
Wed Oct 28 22:17:47 CET 2015


On Thursday 29 October 2015 00:12:14 Igor Mironchik wrote:
> Thank you, guys. But this question doesn't matter for me more, because I 
> need to calculate line number in the file when reading. That mean that I 
> have to skip white spaces by hand...

Why don't you use readLine() instead and keep your count?

> But you pointed me to another very important question... What about some 
> function isLineEnding()? I can use Separator_Line to detect line ending 
> symbol. But how will be read \r\n - line ending on Windows (other OSes) 
> with QTextStream? Will be it one QChar or two different?

QTextStream automatically converts \r\n to a single \n.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list