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:
const double* t = times;
const double* r = recordings;
// add curves
// copy the data into the curves
curve1->setData(qwtArray);
// finally, refresh the plot
qwtPlot->replot();
const double* t = times;
const double* r = recordings;
QwtArrayData qwtArray(t, r, 10);
// add curves
QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1");
// copy the data into the curves
curve1->setData(qwtArray);
curve1->attach(qwtPlot);
// finally, refresh the plot
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
Bookmarks