main.cpp
40 lines
| 987 B
| text/x-c
|
CppLexer
|
r131 | #include <QApplication> | ||
#include <QMainWindow> | ||||
#include <qchartview.h> | ||||
|
r145 | #include <qlinechartseries.h> | ||
|
r131 | #include <qchart.h> | ||
#include <cmath> | ||||
|
r133 | #include "wavegenerator.h" | ||
|
r145 | #include <QGLWidget> | ||
|
r131 | |||
int main(int argc, char *argv[]) | ||||
{ | ||||
QApplication a(argc, argv); | ||||
QMainWindow window; | ||||
|
r156 | QLineChartSeries* series0 = new QLineChartSeries(); | ||
|
r131 | QPen blue(Qt::blue); | ||
blue.setWidth(3); | ||||
series0->setPen(blue); | ||||
|
r156 | QLineChartSeries* series1 = new QLineChartSeries(); | ||
|
r131 | QPen red(Qt::red); | ||
red.setWidth(3); | ||||
series1->setPen(red); | ||||
|
r133 | WaveGenerator generator(series0,series1); | ||
|
r131 | |||
QChartView* chartView = new QChartView(&window); | ||||
|
r145 | chartView->setViewport( new QGLWidget() ); | ||
|
r131 | chartView->setRenderHint(QPainter::Antialiasing); | ||
|
r192 | chartView->setChartTitle("This is wave generator buahha."); | ||
|
r131 | chartView->addSeries(series0); | ||
chartView->addSeries(series1); | ||||
window.setCentralWidget(chartView); | ||||
window.resize(400, 300); | ||||
window.show(); | ||||
return a.exec(); | ||||
} | ||||