-
Notifications
You must be signed in to change notification settings - Fork 9
/
graph_view.cpp
47 lines (36 loc) · 1.17 KB
/
graph_view.cpp
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
42
43
44
45
46
47
#include <QWheelEvent>
#include <QDebug>
#include "graph_view.h"
#include "graph_viewport.h"
#include "grid.h"
#include "candlesticks_overlay.h"
#include "bollinger_overlay.h"
#include <assert.h>
GraphView::GraphView() {
m_viewport = NULL;
}
GraphViewport* GraphView::viewport() {
return m_viewport;
}
void GraphView::internalizeViewport(GraphViewport* viewport) {
qDebug() << "Internalizing new viewport";
m_viewport = viewport;
connect(viewport, SIGNAL(changed()), this, SLOT(notifyOverlaysProjectionChanged()));
connect(viewport, SIGNAL(changed()), this, SLOT(notifyOverlaysRangesChanged()));
connect(viewport, SIGNAL(changed()), this, SLOT(redraw()));
}
void GraphView::addOverlays() {
qDebug() << "Adding overlays";
overlays.push_back(new Grid());
overlays.push_back(new BollingerOverlay());
overlays.push_back(new CandlesticksOverlay());
// connect(candlesticks, SIGNAL(candleEntered(QDateTime)), this, SLOT(candleEntered(QDateTime)));
// connect(candlesticks, SIGNAL(candleLeft), this, SLOT(candleLeft));
}
void GraphView::candleEntered(QDateTime start) {
// TODO
qDebug() << "candle entered:" << start;
}
void GraphView::candleLeft() {
qDebug() << "candle exited";
}