Well, there's also an alternative to modifying the QCustomPlot sources, but it comes with a disclaimer. Consider this specialization:
class MyType; //< Whatever your type is
template <>
static inline QVector<MyType> QVector<MyType>::fromStdVector(const std::vector<MyType> & vector)
{
QVector<MyType> tmp;
tmp.d = QTypedArrayData<MyType>::fromRawData(vector.data(), vector.size(), Unsharable);
return tmp;
}
Here goes the disclaimer:
I haven't tested that, it's hacking into Qt's internals, so use at your own discretion.
You have to ensure the std::vector instance will not go out of scope while any one QVector instance holds reference to the data