From d24f813f3f2a05c112e803e4256b53535895fc98 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Wed, 14 Jul 2021 11:49:10 +1200 Subject: Initial mirror commit --- src/charts/ChartMarker.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/charts/ChartMarker.h (limited to 'src/charts/ChartMarker.h') diff --git a/src/charts/ChartMarker.h b/src/charts/ChartMarker.h new file mode 100644 index 0000000..1f3d81e --- /dev/null +++ b/src/charts/ChartMarker.h @@ -0,0 +1,36 @@ +#ifndef CHART_MARKER_H +#define CHART_MARKER_H + +#include + +class ChartToolTip; + +class ChartMarker: public QGraphicsEllipseItem +{ +public: + ChartMarker(const QPointF& center, const QString& toolTipText); + ~ChartMarker(); + void paint(QPainter* painter, + const QStyleOptionGraphicsItem* option, QWidget* widget = 0); + +protected: + void hoverEnterEvent(QGraphicsSceneHoverEvent* event); + void hoverLeaveEvent(QGraphicsSceneHoverEvent* event); + +private: + void createToolTip(); + +private: + static const QColor Color; + static const int HoverRadius = 15; + static const int Radius = 2; + static const int HighlightedRadius = 4; + static const QPointF ToolTipOffset; + +private: + int radius; + ChartToolTip* toolTip; + QString toolTipText; +}; + +#endif -- cgit