qint32 is a signed 32-bit integer value whose possible range of values is +/- 2,147,483,647. One bit is used for the sign and the remaining 31 bits are used for the value. You may commonly see this also referred to as 2^31.

You may also use QByteArray::append to append your unsigned char values to the QByteArray.