Swapped non const reference for pointer, used qdata_stream writeRawData to write to file, removed unnecessary intializers