点击按钮,画出一条曲线,但是运行之后,就会卡在那,求大神看看哪错了?要调用上一个表格的lineEdit中的数据来参与for循环
//点击按钮,调用的槽函数
void calcresultdialog::on_clicked_sysPerformanceParmCalcButton()
{
//定义两个可变数组存放绘图的坐标数据
QVector<double> x(100),y(100);//分别存放x和y坐标的数据,101为数据长度
for(double R=detectDistMin ; R < detectDistMax ; detectDistMin++)
{
x[R] = R;
y[R] = (targetWidth * focus)/(picSizeWidth * x[R]);
}
//向绘图区域QCustomPlot(从widget提升来的)添加一条曲线
ui.qCustomPlot->addGraph();
//添加数据
ui.qCustomPlot->graph(0)->setData(x,y);
//设置坐标轴标签名称
ui.qCustomPlot->xAxis->setLabel("x");
ui.qCustomPlot->yAxis->setLabel("y");
//设置坐标轴显示范围,否则我们只能看到默认的范围
ui.qCustomPlot->rescaleAxes();
}