-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscene.h
61 lines (50 loc) · 1.15 KB
/
scene.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef SCENE_H
#define SCENE_H
#include <QGraphicsScene>
#include <QGraphicsSceneMouseEvent>
#include <QMouseEvent>
class QGraphicsTextItem;
class QGraphicsLineItem;
class CrossX;
class CrossY;
class MainWindow;
class View;
class MyGraphicsScene : public QGraphicsScene
{
Q_OBJECT
public:
MyGraphicsScene(QObject* parent = 0);
void clearXAxis();
void clearYAxis();
void clearCross(qreal x, qreal y);
MainWindow* window;
View* view;
QPointF pX0;
QPointF pX1;
QPointF pY0;
QPointF pY1;
QGraphicsLineItem* lineX;
QGraphicsLineItem* lineY;
QGraphicsTextItem* textX0;
QGraphicsTextItem* textX1;
QGraphicsTextItem* textY0;
QGraphicsTextItem* textY1;
CrossX* crossX0;
CrossX* crossX1;
CrossY* crossY0;
CrossY* crossY1;
bool defXaxis;
bool defYaxis;
bool defCross;
bool defX0;
bool defX1;
bool defY0;
bool defY1;
public slots:
protected:
void mousePressEvent(QGraphicsSceneMouseEvent* mouseEvent);
void mouseMoveEvent(QGraphicsSceneMouseEvent* mouseEvent);
private:
QPointF p;
};
#endif