On 03/07/2016 09:35 AM, Sina Dogru wrote:
Well but, I am writing a QString to QByteArray,

QByteArray bai;
QDataStream out(&bai, QIODevice::WriteOnly);
out << QString("A QString");

And writing an 'int' and QByteArray which a QString written

file.open(QIODevice::WriteOnly);
QDataStream out2(&file); // and module A write those datas to a file.
out2 << bai.size();
out2 << bai;


All I care about is the QDataStream.

You wrote the size() of QByteArray (which may or may not be an int)
and then you read an int.

You wrote a QByteArray and then you read a QString.
I do not care what is in the QByteArray which you wrote.

You should read back a QByteArray and then, in a subsequent
operation, extract the QString from that.

I might screwed totally? :S

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

Reply via email to