I have been using the QwtRasterData::contourLines() function to get contours from some data functions, and ran into an issue when the raster data is NaN-valued. At the edge of the function domain where the values are NaN on one side and finite on another, I am seeing zigzag contour lines being generated. I attempted to resolve this by using the QwtRasterData::IgnoreOutOfRange flag with some finite interval, but QwtInterval::contains() always returns true if the interval is valid and the test value is NaN. Because NaN always compares false against any other value, the test logic does not make sense here.
I suggest a NaN check the same way there is a QwtInterval::isValid() check (see attached patch), or at least a similar check within the QwtRasterData::contourLines() function to avoid the out-of-range contour lines.