Can I read binary data (for example 9 bytes) directly to QString from file? fread does not work with QString for me (requires char*), QDataStream also requires char* and serialized data example does not appear to be sutable for binary data.
Can I read binary data (for example 9 bytes) directly to QString from file? fread does not work with QString for me (requires char*), QDataStream also requires char* and serialized data example does not appear to be sutable for binary data.
Last edited by zolookas; 29th July 2008 at 17:15. Reason: added url
How about using QDataStream::readRawData()?
http://doc.trolltech.com/4.3/qdatastream.html#raw
edit: Nevermind, I misread your post. Sorry...
Can you use QString::data() and cast that (QChar) pointer to a regular char* ?
QByteArray is the appropriate class are when you need to store raw binary data.
J-P Nurmi
Bookmarks