Function call problem
-
Hi all,
I am working with QCustomPlot graph and I am trying to add data to plot.
I am trying to copy data from one plot to another in this way:
//fetch data QVector<double> *xDataToPlot = getTraces().at(i)->getXData(); QList<float> *yDataToPlot = getTraces().at(i)->getYData(); //add data to new graph printScreen->getTraces().at(i)->getGraph()->addData(xDataToPlot, yDataToPlot);
I can not compile this part of code.
Function addData is QCustomPlot function that is tefined as:void QCPGraph::addData ( const QVector< double > & keys, const QVector< double > & values,bool alreadySorted = false void QCPGraph::addData ( double key,double value ) It can be found here https://www.qcustomplot.com/documentation/classQCPGraph.html#ae0555c0d3fe0fa7cb8628f88158d420f Any suggestions?
-
Hi all,
I am working with QCustomPlot graph and I am trying to add data to plot.
I am trying to copy data from one plot to another in this way:
//fetch data QVector<double> *xDataToPlot = getTraces().at(i)->getXData(); QList<float> *yDataToPlot = getTraces().at(i)->getYData(); //add data to new graph printScreen->getTraces().at(i)->getGraph()->addData(xDataToPlot, yDataToPlot);
I can not compile this part of code.
Function addData is QCustomPlot function that is tefined as:void QCPGraph::addData ( const QVector< double > & keys, const QVector< double > & values,bool alreadySorted = false void QCPGraph::addData ( double key,double value ) It can be found here https://www.qcustomplot.com/documentation/classQCPGraph.html#ae0555c0d3fe0fa7cb8628f88158d420f Any suggestions?
-
It seems, for keys you can just use
*xDataToPlot
, but for values you need to transform theQList<float>
to aQVector<double>
. -
@aha_1980 said in Function call problem:
It seems, for keys you can just use
*xDataToPlot
, but for values you need to transform theQList<float>
to aQVector<double>
.Thank you. I have been looking at this since last night :-)