Example from "Qwt User's Guide" doesn't work
Hi
Example from "Qwt User's Guide" doesn't work: http://qwt.sourceforge.net/class_qwt...oint_data.html
Output
Quote:
C:\Users\Ivan\qt_projects\qwt\Sin\main.cpp:29: error: no matching function for call to 'QwtPlotCurve::setData(SinusData)'
Quote:
c:\Qwt-6.0.2\include\qwt_plot_seriesitem.h:168: candidates are: void QwtPlotSeriesItem<T>::setData(QwtSeriesData<T>*) [with T = QPointF]
Code:
#include <cmath>
#include <qwt_series_data.h>
#include <qwt_plot_curve.h>
#include <qwt_plot.h>
#include <qapplication.h>
class SinusData: public QwtSyntheticPointData
{
public:
SinusData():
QwtSyntheticPointData(100)
{
}
virtual double y(double x) const
{
return qSin(x);
}
};
int main(int argc, char **argv)
{
plot.
setAxisScale(QwtPlot::xBottom,
0.0,
10.0);
plot.
setAxisScale(QwtPlot::yLeft,
-1.0,
1.0);
curve->setData(SinusData());
curve->attach(&plot);
plot.show();
return a.exec();
}
Thanks
Re: Example from "Qwt User's Guide" doesn't work
It's very important for me. Please, help me!
Why this line doesn't work:
Code:
curve->setData(SinusData());
Re: Example from "Qwt User's Guide" doesn't work
A "new" is missing in the docs - that's all. But this something the compiler told you already.
Uwe
Re: Example from "Qwt User's Guide" doesn't work
Thanks! I'm happy :)
Code:
curve->setData(new SinusData());