Just as a note, this will break on machines with 64-bit integers (including, I assume, ours).  You have to be careful to use explicit widths when streaming with QDataStream.