Set data of qtchart by pointer
Solved
General and Desktop
-
wrote on 2 Mar 2018, 07:24 last edited by
Hi. I have two large arrays (unsigned integer 64) with same length, is it possible to pass these arrays via two pointers as values of Xaxis and Yaxis? Thanks.
-
Hi. I have two large arrays (unsigned integer 64) with same length, is it possible to pass these arrays via two pointers as values of Xaxis and Yaxis? Thanks.
wrote on 2 Mar 2018, 09:47 last edited by VRonin 3 Feb 2018, 09:48Not directly, you can do:
const auto arrLen = std::extent<declype(arrX)>::value; Q_ASSERT(std::extent<declype(arrY)>::value == arrLen); /* QXYSeries* m_series; <- in header and created on the heap*/ for(decltype(arrLen) i=0;i<arrLen;++i) m_series->append(arrX[i],arrY[i]);
1/2