Hello
Based on this topic, I would like to know:
Is there another reasonable way of converting a struct to a QByteArray that doesn't use QDataStream?
Thanks,
Momergil
Edit: the only other way I'm aware now is:
MyStruct structTemp;
//Fill structTemp
char buffTemp[sizeof(structTemp)];
memcpy(buffTemp, &structTemp, sizeof(structTemp));
MyStruct structTemp;
//Fill structTemp
char buffTemp[sizeof(structTemp)];
memcpy(buffTemp, &structTemp, sizeof(structTemp));
QByteArray baTemp = QByteArray::fromRawData(buffTemp,sizeof(structTemp)));
To copy to clipboard, switch view to plain text mode
Bookmarks