Assuming that FunctionData is taken from the sinusplot example the code above doesn't make much sense - together with the rest of your question.

Better take this code for learning the very basics of how to show a curve on a QwtPlot: http://qwt.svn.sourceforge.net/viewv...75&view=markup.

Uwe

Qt Code:
  1. int main( int argc, char **argv )
  2. {
  3. QApplication a( argc, argv );
  4.  
  5. QwtPlot plot;
  6. plot.setTitle( "Plot Demo" );
  7. plot.setCanvasBackground( Qt::white );
  8. plot.setAxisScale( QwtPlot::yLeft, 0.0, 10.0 );
  9. plot.insertLegend( new QwtLegend() );
  10.  
  11. QwtPlotGrid *grid = new QwtPlotGrid();
  12. grid->attach( &plot );
  13.  
  14. QwtPlotCurve *curve = new QwtPlotCurve();
  15. curve->setTitle( "Some Points" );
  16. curve->setPen( QPen( Qt::blue, 4 ) ),
  17. curve->setRenderHint( QwtPlotItem::RenderAntialiased, true );
  18.  
  19. QwtSymbol *symbol = new QwtSymbol( QwtSymbol::Ellipse,
  20. QBrush( Qt::yellow ), QPen( Qt::red, 2 ), QSize( 8, 8 ) );
  21. curve->setSymbol( symbol );
  22.  
  23. QPolygonF points;
  24. points << QPointF( 0.0, 4.4 ) << QPointF( 1.0, 3.0 )
  25. << QPointF( 2.0, 4.5 ) << QPointF( 3.0, 6.8 )
  26. << QPointF( 4.0, 7.9 ) << QPointF( 5.0, 7.1 );
  27. curve->setSamples( points );
  28.  
  29. curve->attach( &plot );
  30.  
  31. plot.resize( 600, 400 );
  32. plot.show();
  33.  
  34. return a.exec();
  35. }
To copy to clipboard, switch view to plain text mode