Can anybody give me a schema to do the fastest conversion betwen
QVector<float>
or float []
to-from Qvector<QPointF> ????
Thanks
Can anybody give me a schema to do the fastest conversion betwen
QVector<float>
or float []
to-from Qvector<QPointF> ????
Thanks
QPointF being essentially a pair of floating-point numbers, it is unclear what kind of conversion you want to do. Please specify it.
Qt Code:
QVector<float> vf; QVector<QPointF> vp; foreach(float f, vf) { }To copy to clipboard, switch view to plain text mode
And there is no way to do a mem copy operation ?
The information of origin - destiny are going to be the same 10 floats >>> 5 QfointF (in example )
Any idea ?
No, you must not perform a raw memory copy. Use a loop to transform the elements as wysota suggested. I do not understand what you mean by "origin" or "destiny". Do you mean that the (2 * i)th and (2 * i + 1)th elements of the Qvector<float> should be cast to -- qreal being typedef'd to double or float depending on the architecture --, respectively, the x and y fields of the ith element of the Qvector<QPointF>?
tonnot (3rd September 2011)
tonnot (3rd September 2011)
Bookmarks