开发者

Convert double array to QByteArray

What is the best way to convert a double array (double*) to a QByteArray ?

I have the size of the array. I thought of converting each double to a QByteArray and then append all the arrays to a big QByteArray.

For the other way, well maybe parse the data to many QByteArrays (one for each double) and convert them to double.

I don't know which QByteArray metho开发者_开发技巧d to use for an efficient parsing ?

Thanks


If you have double* da and size of that array s you may use the following:

QByteArray::fromRawData(reinterpret_cast<const char*>(da),s*sizeof(double))
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜