-1

I have two QList (XList, YList) which saves the dynamic data. I want to use these as the input of the QwtPlotCurves by setSamples. After I check the documentation:

void    setSamples (const double *xData, const double *yData, int size)
void    setSamples (const QVector< double > &xData, const QVector< double > &yData)
void    setSamples (const QVector< QPointF > &)

It seems do not support QList. Is there workaround to this or do I have to overload it?

Julio

colddie
  • 1,029
  • 1
  • 15
  • 28

1 Answers1

1

There is method in QList that returns a const QVector.

So:

setSamples( XList.toVector(), YList.toVector()  )

Check QVector QList::toVector () const

trompa
  • 1,967
  • 1
  • 18
  • 26