Hi all,

I implemented my own QwtData which works with a ring buffer and is filled from a different thread than the plot.
Because the Plotter stops the plot with a QMutex before setting rawData
Qt Code:
  1. curveList[a]->setRawData(dataList[a].x(), dataList[a].y(), dataList[a].size());
To copy to clipboard, switch view to plain text mode 
everything worked fine.


Qt Code:
  1. void ValuePlotData::append(qint64 xValue, qint64 yValue)
  2. {
  3. if(currentValuecount == arraySize)
  4. {
  5. long newArraySize = arraySize*2;
  6. double * d_x_new = new double[newArraySize];
  7. double * d_y_new = new double[newArraySize];
  8. for(int i=0;i<arraySize;i++)
  9. {
  10. d_x_new[i]=d_x[i];
  11. d_y_new[i]=d_y[i];
  12. }
  13. delete [] d_x;
  14. delete [] d_y;
  15. d_x = d_x_new;
  16. d_y = d_y_new;
  17. arraySize = newArraySize;
  18. }
  19. d_x[currentValuecount] = xValue;
  20. d_y[currentValuecount] = yValue;
  21. currentValuecount++;
  22. }
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. double ValuePlotData::x(size_t i) const
  2. {
  3. return d_x[offset+(int)i];
  4. }
To copy to clipboard, switch view to plain text mode 

Now I had to use a zoomer for the plot and problems started.

Whenever I zoom in or out there is a chance of the program crashing with a "call to pure virtual method".
After getting post mortem debugging ready I found out, that a replot was issued and it died as I believe on Calling .x() method

I initialize the zoomer with AutoReplot(false) but still it seems to crash because of that.

How do you take care of concurrency issues with your plot, because I don't think it is wise to fill from the gui thread for many new values.

Thanks in advance, this has allready cost me several hours.

sun