-
Notifications
You must be signed in to change notification settings - Fork 9
/
grid.h
37 lines (31 loc) · 930 Bytes
/
grid.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
#ifndef GRID_H_INCLUDED
#define GRID_H_INCLUDED
#include <QtWidgets>
#include "graph_overlay.h"
#include "axis_pair.h"
class Grid: public GraphOverlay {
Q_OBJECT
private:
AxisPair axisPair;
bool drawTimeLabels;
public slots:
virtual void timeAxisChanged(TimeAxis timeAxis);
virtual void numberAxisChanged(NumberAxis numberAxis);
virtual void projectionChanged(OHLCProvider* projection);
public:
Grid(bool drawTimeLabels = true);
virtual void insertIntoScene(QGraphicsScene* scene);
class GridGraphics: public QGraphicsItem {
public:
GridGraphics(AxisPair axisPair, bool drawTimeLabels);
void paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget);
QRectF boundingRect() const;
QPainterPath shape() const;
private:
bool drawTimeLabels;
AxisPair axisPair;
QList<QPair<QDateTime, QString> > xlabels;
QList<QPair<float, QString> > ylabels;
};
};
#endif