##// END OF EJS Templates
Fixed compilation of test/example apps
Fixed compilation of test/example apps

File last commit:

r27:cdbe8dbbb49f
r27:cdbe8dbbb49f
Show More
main.cpp
55 lines | 1.3 KiB | text/x-c | CppLexer
Michal Klocek
adds missing files form previous commit
r12 #include <QApplication>
#include <QMainWindow>
#include <qchartwidget.h>
Michal Klocek
Refactor current draft to fit int current design specs...
r21 #include <qxychartseries.h>
Michal Klocek
adds missing files form previous commit
r12 #include <qchart.h>
#include <cmath>
QCHART_USE_NAMESPACE
#define PI 3.14159265358979
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QMainWindow window;
Michal Klocek
Refactor current draft to fit int current design specs...
r21 QXYChartSeries* series0 = QXYChartSeries::create();
Michal Klocek
adds missing files form previous commit
r12 series0->setColor(Qt::blue);
Michal Klocek
Refactor current draft to fit int current design specs...
r21 QXYChartSeries* series1 = QXYChartSeries::create();
Michal Klocek
adds missing files form previous commit
r12 series1->setColor(Qt::red);
Michal Klocek
Refactor current draft to fit int current design specs...
r21 QXYChartSeries* series2 = QXYChartSeries::create();
Michal Klocek
adds missing files form previous commit
r12 series2->setColor(Qt::gray);
Michal Klocek
Refactor current draft to fit int current design specs...
r21 QXYChartSeries* series3 = QXYChartSeries::create();
Michal Klocek
adds missing files form previous commit
r12 series3->setColor(Qt::green);
int numPoints = 100;
for (int x = 0; x < numPoints; ++x) {
series0->add(x,0);
Michal Klocek
change function example in xylinechart example
r14 series1->add(x, abs(sin(PI/50*x)*100));
series2->add(x, abs(cos(PI/50*x)*100));
Michal Klocek
adds missing files form previous commit
r12 series3->add(x,100);
}
Michal Klocek
Refactor current draft to fit int current design specs...
r21 QList<QXYChartSeries*> dataset;
Michal Klocek
adds missing files form previous commit
r12
Michal Klocek
Refactor current draft to fit int current design specs...
r21 //qDebug()<<"Series 1:" << *series1;
//qDebug()<<"Series 2:" << *series2;
Michal Klocek
adds missing files form previous commit
r12
dataset << series0;
dataset << series1;
dataset << series2;
dataset << series3;
Michal Klocek
Refactor current draft to fit int current design specs...
r21 QChartWidget* chartWidget = new QChartWidget(&window);
chartWidget->addSeries(series1);
chartWidget->addSeries(series2);
Michal Klocek
adds missing files form previous commit
r12
Michal Klocek
Refactor current draft to fit int current design specs...
r21 window.setCentralWidget(chartWidget);
Michal Klocek
adds missing files form previous commit
r12 window.resize(400, 300);
window.show();
return a.exec();
}