errorString() is a method of QFile's base class QIOStream.
What do you mean a section of text and binary?
Using QDataStream you will read binary data.
Your code
will not read some ascii from a (text) file, but rather the serialized binary representation of a QString which is something entirely different.Qt Code:
QDataSteam in(&file); QString inin; in >> inin;To copy to clipboard, switch view to plain text mode
If you read ascii text with that code, interesting but unintended things will happen.
Bookmarks