@@ -10,7 +10,7 TARGET = dynamicLineChart | |||||
10 | TEMPLATE = app |
|
10 | TEMPLATE = app | |
11 | QT += core gui |
|
11 | QT += core gui | |
12 | SOURCES += main.cpp |
|
12 | SOURCES += main.cpp | |
13 |
HEADERS += |
|
13 | HEADERS += wavegenerator.h | |
14 |
|
14 | |||
15 |
|
15 | |||
16 |
|
16 |
@@ -4,7 +4,7 | |||||
4 | #include <qxychartseries.h> |
|
4 | #include <qxychartseries.h> | |
5 | #include <qchart.h> |
|
5 | #include <qchart.h> | |
6 | #include <cmath> |
|
6 | #include <cmath> | |
7 |
#include " |
|
7 | #include "wavegenerator.h" | |
8 |
|
8 | |||
9 | int main(int argc, char *argv[]) |
|
9 | int main(int argc, char *argv[]) | |
10 | { |
|
10 | { | |
@@ -21,15 +21,12 int main(int argc, char *argv[]) | |||||
21 | red.setWidth(3); |
|
21 | red.setWidth(3); | |
22 | series1->setPen(red); |
|
22 | series1->setPen(red); | |
23 |
|
23 | |||
24 | for (int x = 0; x <= numPoints; ++x) { |
|
24 | WaveGenerator generator(series0,series1); | |
25 | series0->add(x, fabs(sin(PI/50*x)*100)); |
|
|||
26 | series1->add(x, fabs(cos(PI/50*x)*100)); |
|
|||
27 | } |
|
|||
28 |
|
25 | |||
29 | QChartView* chartView = new QChartView(&window); |
|
26 | QChartView* chartView = new QChartView(&window); | |
30 |
|
27 | |||
31 | chartView->setRenderHint(QPainter::Antialiasing); |
|
28 | chartView->setRenderHint(QPainter::Antialiasing); | |
32 |
chartView->setTitle(" |
|
29 | chartView->setTitle("This is wave generator buahha."); | |
33 | chartView->addSeries(series0); |
|
30 | chartView->addSeries(series0); | |
34 | chartView->addSeries(series1); |
|
31 | chartView->addSeries(series1); | |
35 |
|
32 | |||
@@ -37,7 +34,5 int main(int argc, char *argv[]) | |||||
37 | window.resize(400, 300); |
|
34 | window.resize(400, 300); | |
38 | window.show(); |
|
35 | window.show(); | |
39 |
|
36 | |||
40 | Updater updater(series0,series1); |
|
|||
41 |
|
||||
42 | return a.exec(); |
|
37 | return a.exec(); | |
43 | } |
|
38 | } |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now