Hey Community,
I am running the following piece of code on a Windows 7 machine and the output seems really strange. I get a string length of 0 back.
Am I missing something?
Thanks a lot
Alex
Code:
Printable View
Hey Community,
I am running the following piece of code on a Windows 7 machine and the output seems really strange. I get a string length of 0 back.
Am I missing something?
Thanks a lot
Alex
Code:
from the documentation for QDataStream:
you are reading it out as a QString, so you must also write it in as a QStringQuote:
Each item written to the stream is written in a predefined binary format that varies depending on the item's type. Supported Qt types include QBrush, QColor, QDateTime, QFont, QPixmap, QString, QVariant and many others. For the complete list of all Qt types supporting data streaming see the Format of the QDataStream operators.
you need to change:
out << "test"
to
out << QString("test")
Try:
/edit:
I was too slow...
Argh.. could've seen that one myself.
Thanks you two...