Hi,
I am just trying to get started with qwt. I have set up a form with a widget on it. I am trying to conect this widget to a qwt plot but the diagram is never displayed. Any idea?
Regards,
mikl
// Insert new curves
cSin
->setLegendAttribute
(QwtPlotCurve::LegendShowLine,
true);
cSin
->setPen
(QPen(Qt
::red));
cSin->setData(new FunctionData(::sin));
cSin->attach(myPlot);
myPlot->replot();
QwtPlot *myPlot = new QwtPlot(ui->widget);
// Insert new curves
QwtPlotCurve *cSin = new QwtPlotCurve("y = sin(x)");
cSin->setRenderHint(QwtPlotItem::RenderAntialiased);
cSin->setLegendAttribute(QwtPlotCurve::LegendShowLine, true);
cSin->setPen(QPen(Qt::red));
cSin->setData(new FunctionData(::sin));
cSin->attach(myPlot);
myPlot->replot();
To copy to clipboard, switch view to plain text mode
Edit: Could it be myPlot->show() that is needed? (Want to go home testing)
Bookmarks