-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscene.cpp
151 lines (95 loc) · 3.79 KB
/
scene.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#include "scene.h"
//#include "databaseoperator.h"
Scene::Scene(QGraphicsScene *parent)
:QGraphicsScene(parent)
{
//QVector<interpulse> millionData = DB_T_InterPulse::findInterPulseData();
//QVector<InterPulse> million_data_vector;
setBackgroundBrush(Qt::gray);
//脉间chart
chart1_ = new Chart();
chart2_ = new Chart();
chart3_ = new Chart();
chart4_ = new Chart();
chart5_ = new Chart();
//脉内chart
interChart1_=new InternalPulseChart();
interChart2_=new InternalPulseChart();
interChart3_=new InternalPulseChart();
interChart4_=new InternalPulseChart();
//设置脉间,脉内chart属性
setAllChartProperties();
//给所有chart(脉间,脉内)设置边距
setAllChartsMargins();
}
//设置脉间,脉内chart属性
void Scene::setAllChartProperties(){
//脉间
chart1_->setTitle("Frequency");
chart2_->setTitle("DTOA");
chart3_->setTitle("Width");
chart4_->setTitle("Amp");
chart5_->setTitle("Direction");
chart1_->setTitleBrush(QColor::fromRgb(0, 204, 204));
chart2_->setTitleBrush(QColor::fromRgb(0, 204, 204));
chart3_->setTitleBrush(QColor::fromRgb(0, 204, 204));
chart4_->setTitleBrush(QColor::fromRgb(0, 204, 204));
chart5_->setTitleBrush(QColor::fromRgb(0, 204, 204));
chart1_->setBackgroundBrush(QColor::fromRgb(55, 55, 55));
chart2_->setBackgroundBrush(QColor::fromRgb(55, 55, 55));
chart3_->setBackgroundBrush(QColor::fromRgb(55, 55, 55));
chart4_->setBackgroundBrush(QColor::fromRgb(55, 55, 55));
chart5_->setBackgroundBrush(QColor::fromRgb(55, 55, 55));
//脉内
interChart1_->setTitle("Intermediate frequency waveform");
interChart2_->setTitle("frequency spectrum");
interChart3_->setTitle("time-frequency");
interChart4_->setTitle("phase difference");
interChart1_->setBackgroundBrush(QColor::fromRgb(55, 55, 55));
interChart2_->setBackgroundBrush(QColor::fromRgb(55, 55, 55));
interChart3_->setBackgroundBrush(QColor::fromRgb(55, 55, 55));
interChart4_->setBackgroundBrush(QColor::fromRgb(55, 55, 55));
interChart1_->setTitleBrush(QColor::fromRgb(0, 204, 204));
interChart2_->setTitleBrush(QColor::fromRgb(0, 204, 204));
interChart3_->setTitleBrush(QColor::fromRgb(0, 204, 204));
interChart4_->setTitleBrush(QColor::fromRgb(0, 204, 204));
}
//给脉间chart设置边距,使得最大显示
void Scene::setAllChartsMargins(){
//脉间
chart1_->setMargins(QMargins(0,0,0,0));
chart2_->setMargins(QMargins(0,0,0,0));
chart3_->setMargins(QMargins(0,0,0,0));
chart4_->setMargins(QMargins(0,0,0,0));
chart5_->setMargins(QMargins(0,0,0,0));
//脉内
interChart1_->setMargins(QMargins(0,0,0,0));
interChart2_->setMargins(QMargins(0,0,0,0));
interChart3_->setMargins(QMargins(0,0,0,0));
interChart4_->setMargins(QMargins(0,0,0,0));
}
void Scene::keyPressEvent(QKeyEvent *event){
qDebug()<<"scene--keyPressEvent";
QGraphicsScene::keyPressEvent(event);
}
void Scene::mousePressEvent(QGraphicsSceneMouseEvent *event){
qDebug()<<"scene--mousePressEvent";
QGraphicsScene::mousePressEvent(event);
}
void Scene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event){
qDebug()<<"scene--mouseReleaseEvent";
QGraphicsScene::mouseReleaseEvent(event);
}
void Scene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event){
QGraphicsScene::mouseDoubleClickEvent(event);
}
void Scene::wheelEvent(QGraphicsSceneWheelEvent *event){
QGraphicsScene::wheelEvent(event);
}
//Scene::~Scene(){
// delete chart1_;
// delete chart2_;
// delete chart3_;
// delete chart4_;
// delete chart5_;
//}