Well, for one thing, if you read the documentation for QwtPlotCurve::setRawData(), the pointers to the x and y arrays must be valid for the entire life of the curve. In lines 47-48, you create new arrays, then pass them into the curve, then in 58-59, you delete them. Thus, QwtPlotCurve is trying to draw using pointers that have already been deleted. If you resize your plot or do anything to cause a replot after the first time it draws those points, the program will probably crash. You have been lucky so far because QwtPlot makes a cache of the plot, which is re-built only when something changes to require a replot.
Second, you are passing your data in as QList of QStringList of QString, then parsing 5000 points from deep down inside this structure from strings into doubles. Why? If all you are interested in is the y values buried down inside this complex data structure, find a way to pass them in as a QVector of doubles instead of converting them into strings and burying them.
The slowness isn't Qwt's fault at all, it is the way you have chosen to represent and access your data. You are making your PC do so much extra work, I am surprised your PC didn't burn up.
Bookmarks