-
Notifications
You must be signed in to change notification settings - Fork 9
/
macd_overlay.h
41 lines (33 loc) · 980 Bytes
/
macd_overlay.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef MACD_OVERLAY_H_INCLUDED
#define MACD_OVERLAY_H_INCLUDED
#include "axis_pair.h"
#include "graph_overlay.h"
#include <QList>
#include <QGraphicsItem>
#include "macd_calculator.h"
class GraphViewport;
class MACDOverlay: public GraphOverlay {
Q_OBJECT
private:
GraphViewport* viewport;
AxisPair axisPair;
OHLCProvider* projection;
class Graphics: public QGraphicsItem {
private:
AxisPair axisPair;
public:
Graphics(AxisPair pair);
QList<QPair<QDateTime, MACDCalculator::Entry>> data;
QRectF boundingRect() const;
QPainterPath shape() const;
void paint(QPainter *painer, const QStyleOptionGraphicsItem *item, QWidget *widget);
};
public slots:
virtual void timeAxisChanged(TimeAxis timeAxis);
virtual void numberAxisChanged(NumberAxis numberAxis);
virtual void projectionChanged(OHLCProvider* projection);
public:
MACDOverlay(GraphViewport* viewport);
virtual void insertIntoScene(QGraphicsScene* scene);
};
#endif