C++ QwtPlot尝试显示包含8000个点的曲线时发送运行时异常
我试图在C++ QwtPlot尝试显示包含8000个点的曲线时发送运行时异常,c++,qt,qwt,C++,Qt,Qwt,我试图在QwtPlot和replot中每20毫秒显示两条曲线。但当我运行程序时,它会抛出一个运行时异常 以下是我的变量: QwtPlot * spectrum = new QwtPlot(); QwtPlotCurve * Tcurve = new QwtPlotCurve(); QwtPlotCurve * Scurve = new QwtPlotCurve(); QpolygonF Tpoints; QpolygonF Spoints; const int count = 1; 下面是我每
QwtPlot
和replot
中每20毫秒显示两条曲线。但当我运行程序时,它会抛出一个运行时异常
以下是我的变量:
QwtPlot * spectrum = new QwtPlot();
QwtPlotCurve * Tcurve = new QwtPlotCurve();
QwtPlotCurve * Scurve = new QwtPlotCurve();
QpolygonF Tpoints;
QpolygonF Spoints;
const int count = 1;
下面是我每次回复spectrum时的代码:
for(i=0;i<4006;i+=count)
{
Tpoints << QPointF(i,intArray[i]);
}
for(;i<8012;i+=count)
{
Spoints << QPointF(i-4005,intArray[i]);
}
Tcurve->setSamples(Tpoints);
Scurve->setSamples(Spoints);
Tcurve->attach(spectrum);
Scurve->attach(spectrum);
spectrum->replot();
for(i=0;iattach(光谱);
频谱->replot();
通过UDP套接字连接,intArray
阵列每毫秒更新一次,但频谱每20毫秒更新一次
进一步信息:QwtPlot的大小为1000x280以下是异常窗口:
提前感谢您的帮助,您遇到了什么异常?@DmitrySazonov:“Visual Studio实时调试器”窗口弹出,这是消息:“myProg.exe中发生了未处理的win32异常。[3056]当我将
count
常量更改为50或100时,它工作正常,但如果count
为1,它就不工作了…数组中的大小是多少?为什么需要更改“count”/为什么不简单地编写I++
?或者如果您懒得调试,在代码中放置一些qDebug。。。