Note that there is also: QwtPlotRasterItem::setAlpha(). The advantage of using this is that you can modify the alpha value without having to re-render the image. Advantage of your code is, that the alpha value is part of the cached image and when drawing the image from the cache the cycle for updating the alpha value can be avoided.

So when you need to do something like with the slider of the spectrogram example QwtPlotRasterItem::setAlpha(), might be better. Otherwise your code might be faster ( if this matters ).

Uwe