For plotting the graph I'm using QcustomPlot. My question is: How to plot a graph into an infinite loop with a few second delay of a random variable to whom a cancel button is pressed?
QVector<double> x(101), y(101);
for (int i=0; i<101; ++i)
{
x[i] = i;
y[i] = i;
}
customPlot->addGraph();
customPlot->graph(0)->setData(x, y);
customPlot->xAxis->setLabel("x");
customPlot->yAxis->setLabel("y");
customPlot->xAxis->setRange(-1, 1);
customPlot->yAxis->setRange(0, 1);
customPlot->replot();
QVector<double> x(101), y(101);
for (int i=0; i<101; ++i)
{
x[i] = i;
y[i] = i;
}
customPlot->addGraph();
customPlot->graph(0)->setData(x, y);
customPlot->xAxis->setLabel("x");
customPlot->yAxis->setLabel("y");
customPlot->xAxis->setRange(-1, 1);
customPlot->yAxis->setRange(0, 1);
customPlot->replot();
To copy to clipboard, switch view to plain text mode
Bookmarks