Hi all,

trying to plot in a Qt4 mainwindow, which was layouted with Qt designer. So I have a Ui_MainWindow class, which declares and defines QwtPlot *qwtPlot.

The Ui_MainWindow class is privately inherited by another class, lets call it PlotOri, in order to have access to all the graphical elements.

Here is the part of the constructor of PlotOri, where I try to use the replot() methode:

Qt Code:
  1. const double* t = times;
  2. const double* r = recordings;
  3.  
  4. QwtArrayData qwtArray(t, r, 10);
  5.  
  6. // add curves
  7. QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1");
  8.  
  9. // copy the data into the curves
  10. curve1->setData(qwtArray);
  11.  
  12. curve1->attach(qwtPlot);
  13.  
  14. // finally, refresh the plot
  15. qwtPlot->replot();
To copy to clipboard, switch view to plain text mode 

At runtime I receive a 'Segmentation fault' and the program crashes. Commenting the last line prevents from crashing, but of course I also don't see a plot.

Maybe it is just a newbie's mistake. I hope you can help me and thx in advance.

greetz, kai