PDA

View Full Version : Digram not displayed.



mikl
11th March 2011, 12:46
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


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();

Edit: Could it be myPlot->show() that is needed? (Want to go home testing)

mikl
11th March 2011, 17:07
Show did the trick! :)