I am not sure I completely understand the problem since
I do not see any structure in your read/write code.
But normal way to deal with structures (the same as with classes)
is to write/read every member separate in their natural form with provided by QDataStream functionality.
And you certainly need to know type of the data written to the file to read it properly.
Your problem (as far as I can understand) is related to using wrong function to read integer data,
cause you read it as char data,