PDA

View Full Version : How to copy/convert an array to QVector without iterating?



locke
4th August 2010, 15:00
Hi guys,

I want to copy the information from an array to a Qvector, I know it is simple by iterating the elements, but how to do it without iteration?

I've tried memcpy function but it doesnt work

Thanks

locke
4th August 2010, 17:13
SOLVED:



std::vector<double> auxVector;
auxVector.assign(array, array + numberOfElementsInArray);
m_myQVector.fromStdVector(auxVector);