January 2019
Intermediate to advanced
384 pages
11h 50m
English
These two classes provide a more convenient interface for using the QFile in its two different modes – binary and text.
QTextStream provides a convenient interface for reading and writing text for a file. It will take care of converting the 8-bit data that's physically stored in the file into a UTF-16 Unicode QString. The assumed file encoding is the local system's default encoding (on Linux, it's UTF-8, while it's UTF-16 on Windows), but it can be changed using the setCodec() function. QTextStream will use an internal UTF-16 buffer to speed up this conversion.
Thus, if you are reading a non UTF-16 text file, there will be some cost associated with the format conversion. It is faster to perform this conversion ...
Read now
Unlock full access