C++ (Qt)int val = 7;QByteArray ba("test");ba.append((char *) &val, sizeof(val));
C++ (Qt)int val = 7;QByteArray ba;QDataStream strm(&ba, QIODevice::WriteOnly);strm << val;