qwt qwtplot - Kurve nicht zu sehen[gelöst]
Verfasst: 10. Mai 2007 23:04
Hallo, Hab hier n'kleines Testprogramm geschrieben bei dem die Kurve, die eigentlich da sein sollte nicht zu sehen ist. Was mache ich flasch?? Habs eigentlich vom simple_plot beispiel abgeschaut.
und fkplot.cpp (header nur Konstruktor):
Vielen Dank für eine Antwort
Code: Alles auswählen
#include <QApplication>
#include "fkplot.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
fkplot b(0);
b.show();
return app.exec();
}Code: Alles auswählen
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
#include <qwt_text.h>
#include "fkplot.h"
fkplot::fkplot(QWidget *parent):QwtPlot(parent)
{
setTitle("test");
setAxisTitle(xBottom, "x-->");
setAxisTitle(yLeft, "y-->");
setAxisScale(xBottom, 0, 7);
setAxisScale(yLeft, -300, 300);
double vx[100];
double vy[100];
QwtPlotCurve *kf = new QwtPlotCurve;
kf->setRenderHint(QwtPlotItem::RenderAntialiased);
kf->setPen(QPen(Qt::red));
kf->attach(this);
for(int i=0; i<=99; i++)
{
vx[i]= 7/99*i;
vy[i]= 200*sin(vx[i]);
}
kf->setData(vx, vy, 100);
resize(640,480);
replot();
}