Ok,
Ive managed to half get it working, but not very well. What I have had to do is copy the entire array into the SpectrogramData class, the use the data locally.
Qt Code:
  1. class SpectrogramData: public QwtRasterData
  2. {
  3. public:
  4. QpnwPhasedArrayPlot * someParent;
  5. QVector< QList<double> > someData;
  6. // Provide pointer to QpnwPhasedArrayPlot so we can access the data
  7. SpectrogramData( QpnwPhasedArrayPlot * theParent ):
  8. QwtRasterData(QwtDoubleRect(0.0, 0.0, 180.0, 2000.0)) // Left, bottom, width, height
  9. {
  10. someParent = theParent;
  11. someData = theParent->spectData;
  12. //QMessageBox::information(0,"","Creating Raster");
  13. }
  14. virtual QwtRasterData *copy() const
  15. {
  16. return new SpectrogramData(someParent);
  17. }
  18.  
  19. virtual QwtDoubleInterval range() const
  20. {
  21. return QwtDoubleInterval(0.0, 4096.0);
  22. }
  23.  
  24. virtual double value(double x, double y) const
  25. {
  26. //QMessageBox::information(0,"","Real: " + QString::number(y) + " Round: " + QString::number((unsigned int)y));
  27. QList<double> temp;
  28. if( x < 0.0 || x > 180.0 || y < 0.0 || y > 2000.0 )
  29. return 0.0;
  30. else
  31. {
  32. return someData.at( (unsigned int)x ).at( (unsigned int)y );
  33. }
  34. //return someParent->spectData.at(1).at(1);
  35. //return 100;
  36. }
  37. };
To copy to clipboard, switch view to plain text mode 

I dont know what problems I will have in updating the data, hopefully replot() should take care of it for me, but I'm not sure.
There is surely a better way of doing this, where the SpectrogramData class can access some external data?