Yes using QwtRasterData - QwtMatrixRasterData is derived from it - is the right way to pass your data. Maybe have a look at the spectrogram example.

Uwe