Skip to content

Instantly share code, notes, and snippets.

@symroc
Last active July 7, 2022 15:29
Show Gist options
  • Save symroc/306b24ae8ab6b39c8f313ba001ed92a4 to your computer and use it in GitHub Desktop.
Save symroc/306b24ae8ab6b39c8f313ba001ed92a4 to your computer and use it in GitHub Desktop.
Convert QByteArray to QVector<float>
#include<QByteArray>
#include<QVector>
#include<QDataStream>
QByteArray data;
QDataStream in (data);
in.setByteOrder(QDataStream::LittleEndian);
QVector<float> nums;
while(!in.atEnd()){
float f;
in >> f;
nums<<f;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment