Last active
July 7, 2022 15:29
-
-
Save symroc/306b24ae8ab6b39c8f313ba001ed92a4 to your computer and use it in GitHub Desktop.
Convert QByteArray to QVector<float>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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