{
// Draw the vertical and horizontal lines and call the parent implementation for the other parts.
const int vFirstAbscissa = pXMap.transform(mAbscissaFirstLine);
const int vSecondAbscissa = pXMap.transform(mAbscissaSecondLine);
const int vOrdinate = pYMap.transform(yValue());
// Draw lines
pPainter->setPen(linePen());
//2 vertical lines on the full height of the pBoundingRectangle
QwtPainter::drawLine(pPainter, vFirstAbscissa, pBoundingRectangle.
top(), vFirstAbscissa, pBoundingRectangle.
bottom());
QwtPainter::drawLine(pPainter, vSecondAbscissa, pBoundingRectangle.
top(), vSecondAbscissa, pBoundingRectangle.
bottom());
// One horizontal line between the 2 vertical lines.
QwtPainter::drawLine(pPainter, vFirstAbscissa, vOrdinate, vSecondAbscissa, vOrdinate
);
// Call the parent implementation for the other part of the QwtPlotMarker
}
void LinePlotMarker::draw(QPainter *pPainter,const QwtScaleMap &pXMap, const QwtScaleMap &pYMap, const QRect &pBoundingRectangle) const
{
// Draw the vertical and horizontal lines and call the parent implementation for the other parts.
const int vFirstAbscissa = pXMap.transform(mAbscissaFirstLine);
const int vSecondAbscissa = pXMap.transform(mAbscissaSecondLine);
const int vOrdinate = pYMap.transform(yValue());
// Draw lines
pPainter->setPen(linePen());
//2 vertical lines on the full height of the pBoundingRectangle
QwtPainter::drawLine(pPainter, vFirstAbscissa, pBoundingRectangle.top(), vFirstAbscissa, pBoundingRectangle.bottom());
QwtPainter::drawLine(pPainter, vSecondAbscissa, pBoundingRectangle.top(), vSecondAbscissa, pBoundingRectangle.bottom());
// One horizontal line between the 2 vertical lines.
QwtPainter::drawLine(pPainter, vFirstAbscissa, vOrdinate, vSecondAbscissa, vOrdinate);
// Call the parent implementation for the other part of the QwtPlotMarker
QwtPlotMarker::draw(pPainter,pXMap,pYMap,pBoundingRectangle);
}
To copy to clipboard, switch view to plain text mode
Bookmarks