I want to show a simple graph using QWT and Qt Creator:
Qt version: 4.8.2, Qt Creator: 2.5.2, QWT version: 6.0.0
I added a QwtPlot to my MainWindow (called "myPlot" in the example). Then I have a callback function which is called each time I press a button:
void MainWindow::forwardPlot()
{
double x[9] = {1,20,30,40,50,60,70,200,500};
double y[9] = {1,500,3,1,200,100,2,1,0};
QwtPlotCurve *curve = new QwtPlotCurve();
curve->setRawSamples(x,y,9);
curve->attach( ui->myPlot );
curve->show();
ui->myPlot->replot();
ui->label->setText("bla");
}
Compiling works fine... The label is set to "bla", so I know that the callback function is called. But the curve is not displayed. I am able to resize myPlot for example. But showing the curve does not work. Any hints?