alex_sh
24th January 2011, 17:21
Hello,
Our application sometimes triggers a condition when the Z-interval set for QwtMatrixRasterData is invalid (contains NaNs, for example) because the data itself is invalid. The result is that QwtPlotSpectrogram draws unfilled image from uninitialized memory.
This seems to happen in QwtPlotSpectrogram::renderImage(), near
if ( !intensityRange.isValid() )
return image;
If I modify it to the following, a proper transparent image is returned and the random-colored blocks go away.
if ( !intensityRange.isValid() ) {
image.fill(qRgba(0, 0, 0, 0));
return image;
}
To reproduce, just change
setInterval( Qt::ZAxis, QwtInterval(1.0, 6.0) );
to
setInterval( Qt::ZAxis, QwtInterval(1.0, -1.0) );
in the rasterview example.
Thanks!
Our application sometimes triggers a condition when the Z-interval set for QwtMatrixRasterData is invalid (contains NaNs, for example) because the data itself is invalid. The result is that QwtPlotSpectrogram draws unfilled image from uninitialized memory.
This seems to happen in QwtPlotSpectrogram::renderImage(), near
if ( !intensityRange.isValid() )
return image;
If I modify it to the following, a proper transparent image is returned and the random-colored blocks go away.
if ( !intensityRange.isValid() ) {
image.fill(qRgba(0, 0, 0, 0));
return image;
}
To reproduce, just change
setInterval( Qt::ZAxis, QwtInterval(1.0, 6.0) );
to
setInterval( Qt::ZAxis, QwtInterval(1.0, -1.0) );
in the rasterview example.
Thanks!