QCustomPlot Discussion and Comments

Creating data from array of doublesReturn to overview

Hi all

this is a more generic Qt quesiton...

whats the best way to create a QVector from an array of doubles?

a simple copy will do

QVector<double> vec(size);
std::copy(array, array+size, vec.begin());

Since Qt 5.14 there is a new constructor of QVector which takes iterators. You might be able to do

QVector<double> vec(array, array+size)

but I haven't tested it.