diff options
Diffstat (limited to 'examples/charts/callout/callout.h')
-rw-r--r-- | examples/charts/callout/callout.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/examples/charts/callout/callout.h b/examples/charts/callout/callout.h index 35de08d5..67cc76ff 100644 --- a/examples/charts/callout/callout.h +++ b/examples/charts/callout/callout.h @@ -30,6 +30,7 @@ #ifndef CALLOUT_H #define CALLOUT_H +#include <QtCharts/QChartGlobal> #include <QtWidgets/QGraphicsItem> #include <QtGui/QFont> @@ -37,13 +38,20 @@ QT_BEGIN_NAMESPACE class QGraphicsSceneMouseEvent; QT_END_NAMESPACE +QT_CHARTS_BEGIN_NAMESPACE +class QChart; +QT_CHARTS_END_NAMESPACE + +QT_CHARTS_USE_NAMESPACE + class Callout : public QGraphicsItem { public: - Callout(QGraphicsItem * parent = 0); + Callout(QChart *parent); void setText(const QString &text); void setAnchor(QPointF point); + void updateGeometry(); QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,QWidget *widget); @@ -58,6 +66,7 @@ private: QRectF m_rect; QPointF m_anchor; QFont m_font; + QChart *m_chart; }; #endif // CALLOUT_H |