The class QwtPlotShapeItem is used to display various shapes. If the underlying QPainterPath only contains a horizontal or vertical line (two points with one identical coordinate each), its bouding box has a height or width of zero. In this case, the shape is not displayed on the canvas.
The reason is, that in QwtPlotShapeItem::draw (line 379 in qwt_plot_shapeitem.cpp), the command
d_data->boundingRect.intersects( cRect )
returns false, since the area of the boundingRect is zero.
This bug has already been posted in the QtCentre forum under: http://www.qtcentre.org/threads/64486-QwtPlotShapeItem-does-not-display-line-shapes-%28height-or-width-0%29
Cheers
Marc
itom.bitbucket.org
Anonymous
If solved this bug by replacing the if-condition (line 395) by
(see http://stackoverflow.com/questions/13390333/two-rectangles-intersection)
This is almost the same than the original Qt code for the intersects method does. The isNull() check at the beginning is not necessary but is also done by Qt.
Cheers
Marc
The suggested fix still ignores the situation of being a point, so both isNull() checks can/must be left out. Beside that the check can be written slightly more readable using left/right/top/bottom.
Fixed in all branches >= 6.1