diff --git a/demos/callout/callout.cpp b/demos/callout/callout.cpp index e6dc5ed..22130e2 100644 --- a/demos/callout/callout.cpp +++ b/demos/callout/callout.cpp @@ -31,7 +31,7 @@ void Callout::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, Q if (!m_rect.contains(anchor)) { QPointF point1, point2; - // establish the position of the anchor point in relation to m_textRect + // establish the position of the anchor point in relation to m_rect bool above = anchor.y() <= m_rect.top(); bool aboveCenter = anchor.y() > m_rect.top() && anchor.y() <= m_rect.center().y(); bool belowCenter = anchor.y() > m_rect.center().y() && anchor.y() <= m_rect.bottom(); @@ -42,7 +42,7 @@ void Callout::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, Q bool rightOfCenter = anchor.x() > m_rect.center().x() && anchor.x() <= m_rect.right(); bool onRight = anchor.x() > m_rect.right(); - // get the nearest m_textRect corner. + // get the nearest m_rect corner. qreal x = (onRight + rightOfCenter) * m_rect.width(); qreal y = (below + belowCenter) * m_rect.height(); bool cornerCase = (above && onLeft) || (above && onRight) || (below && onLeft) || (below && onRight); diff --git a/doc/src/demos-callout.qdoc b/doc/src/demos-callout.qdoc index 5f6bb42..126c97a 100644 --- a/doc/src/demos-callout.qdoc +++ b/doc/src/demos-callout.qdoc @@ -6,7 +6,9 @@ This demo shows how to draw an additional element (a callout) on top of the chart. \image demos_callout.png - QChart class provides two methods that map between the scene coordinates and the series' domain (defines by the axes ranges). + QChart class provides two methods that map between the scene coordinates and the series' domain (defined by the axes ranges). + QPointF QChart::mapToPosition(const QPointF &value, QAbstractSeries *series) + QPointF QChart::mapToValue(const QPointF &position, QAbstractSeries *series) */