! Draws the graphical representation of a single statistical box with the data given by the iterator \a it with the provided \a painter. If the statistical box has a set of outlier data points, they are drawn with \a outlierStyle. \see getQuartileBox, getWhiskerBackboneLines, getWhiskerBarLines */
| 25689 | \see getQuartileBox, getWhiskerBackboneLines, getWhiskerBarLines |
| 25690 | */ |
| 25691 | void QCPStatisticalBox::drawStatisticalBox(QCPPainter *painter, QCPStatisticalBoxDataContainer::const_iterator it, const QCPScatterStyle &outlierStyle) const |
| 25692 | { |
| 25693 | // draw quartile box: |
| 25694 | applyDefaultAntialiasingHint(painter); |
| 25695 | const QRectF quartileBox = getQuartileBox(it); |
| 25696 | painter->drawRect(quartileBox); |
| 25697 | // draw median line with cliprect set to quartile box: |
| 25698 | painter->save(); |
| 25699 | painter->setClipRect(quartileBox, Qt::IntersectClip); |
| 25700 | painter->setPen(mMedianPen); |
| 25701 | painter->drawLine(QLineF(coordsToPixels(it->key-mWidth*0.5, it->median), coordsToPixels(it->key+mWidth*0.5, it->median))); |
| 25702 | painter->restore(); |
| 25703 | // draw whisker lines: |
| 25704 | applyAntialiasingHint(painter, mWhiskerAntialiased, QCP::aePlottables); |
| 25705 | painter->setPen(mWhiskerPen); |
| 25706 | painter->drawLines(getWhiskerBackboneLines(it)); |
| 25707 | painter->setPen(mWhiskerBarPen); |
| 25708 | painter->drawLines(getWhiskerBarLines(it)); |
| 25709 | // draw outliers: |
| 25710 | applyScattersAntialiasingHint(painter); |
| 25711 | outlierStyle.applyTo(painter, mPen); |
| 25712 | for (int i=0; i<it->outliers.size(); ++i) |
| 25713 | outlierStyle.drawShape(painter, coordsToPixels(it->key, it->outliers.at(i))); |
| 25714 | } |
| 25715 | |
| 25716 | /*! \internal |
| 25717 |