This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static inline QByteArray IntToArray(qint32 source) //Use qint32 to ensure that the number have 4 bytes | |
{ | |
//Avoid use of cast, this is the Qt way to serialize objects | |
QByteArray temp; | |
QDataStream data(&temp, QIODevice::ReadWrite); | |
data << source; | |
return temp; | |
} |