// virtual from QwtPlotCurve
void SlotCurve
::drawSteps (QPainter *painter,
const QRectF &canvasRect,
int from,
int to
) const {
//---------------------------------------------------------------------
// Fixup to QwtPlotCurve bug which will be fixed after Qwt 6.1.3.
// See QtCentre/Qwt Thread: http://www.qtcentre.org/threads/66464
// "QwtPlotCurve Step CurveStyle incorrect when extending beyond
// QwtPlot edge". [July 2016].
//
// If required, adjust the canvasRect to be larger, on all four sides,
// by the thickness of the drawn curve (i.e. the QPainter QPen width).
//---------------------------------------------------------------------
// Note: QWT_VERSION is (major << 16) + (minor << 8) + patch.
const bool versNeedsCanvasRectExpand = (QWT_VERSION <= 0x060103);
const bool clipOn
= testPaintAttribute
(QwtPlotCurve::ClipPolygons);
QRectF adjustedCanvasRect
(canvasRect
);
if (versNeedsCanvasRectExpand && clipOn)
{
qreal pw = qMax (qreal(1.0), painter->pen().widthF());
adjustedCanvasRect = canvasRect.adjusted (-pw, -pw, pw, pw);
}
// Call the Qwt base class method
adjustedCanvasRect, from, to);
}
// virtual from QwtPlotCurve
void SlotCurve::drawSteps (QPainter *painter,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRectF &canvasRect, int from, int to) const
{
//---------------------------------------------------------------------
// Fixup to QwtPlotCurve bug which will be fixed after Qwt 6.1.3.
// See QtCentre/Qwt Thread: http://www.qtcentre.org/threads/66464
// "QwtPlotCurve Step CurveStyle incorrect when extending beyond
// QwtPlot edge". [July 2016].
//
// If required, adjust the canvasRect to be larger, on all four sides,
// by the thickness of the drawn curve (i.e. the QPainter QPen width).
//---------------------------------------------------------------------
// Note: QWT_VERSION is (major << 16) + (minor << 8) + patch.
const bool versNeedsCanvasRectExpand = (QWT_VERSION <= 0x060103);
const bool clipOn = testPaintAttribute (QwtPlotCurve::ClipPolygons);
QRectF adjustedCanvasRect (canvasRect);
if (versNeedsCanvasRectExpand && clipOn)
{
qreal pw = qMax (qreal(1.0), painter->pen().widthF());
adjustedCanvasRect = canvasRect.adjusted (-pw, -pw, pw, pw);
}
// Call the Qwt base class method
QwtPlotCurve::drawSteps (painter, xMap, yMap,
adjustedCanvasRect, from, to);
}
To copy to clipboard, switch view to plain text mode
Bookmarks