##// END OF EJS Templates
Tuning example code for better screen shots
Tero Ahola -
r343:babaf6244e0f
parent child
Show More
1 NO CONTENT: modified file, binary diff hidden
1 NO CONTENT: modified file, binary diff hidden
1 NO CONTENT: modified file, binary diff hidden
@@ -19,6 +19,7 int main(int argc, char *argv[])
19 19 // Create chart view
20 20 QChartView *chartView = new QChartView();
21 21 chartView->setRenderHint(QPainter::Antialiasing);
22 chartView->setChartTitle("Simple Line Chart");
22 23 // Add series to the chart
23 24 QLineChartSeries *line = new QLineChartSeries();
24 25 line->add(0.0, 0.8);
@@ -27,11 +28,13 int main(int argc, char *argv[])
27 28 chartView->addSeries(line);
28 29 //! [1]
29 30
31 chartView->setChartTitle("\'Scietific\' theme");
30 32 //! [2]
31 33 // Change theme
32 34 chartView->setChartTheme(QChart::ChartThemeScientific);
33 35 //! [2]
34 36
37 chartView->setChartTitle("Simple Pie Chart");
35 38 //! [3]
36 39 // Add pie series
37 40 // ...
@@ -41,6 +44,7 int main(int argc, char *argv[])
41 44 chartView->addSeries(pie);
42 45 //! [3]
43 46
47 chartView->setChartTitle("Simple Scatter Chart");
44 48 //! [4]
45 49 // Add scatter series
46 50 // ...
@@ -52,6 +56,7 int main(int argc, char *argv[])
52 56 chartView->addSeries(scatter);
53 57 //! [4]
54 58
59 chartView->setChartTitle("Simple Bar Chart");
55 60 //! [5]
56 61 // ...
57 62 // Add bar series
@@ -69,8 +74,9 int main(int argc, char *argv[])
69 74 //! [5]
70 75
71 76 QMainWindow w;
72 w.resize(380, 250);
77 w.resize(400, 300);
73 78 w.setCentralWidget(chartView);
79 w.setWindowFlags(Qt::FramelessWindowHint);
74 80 w.show();
75 81
76 82 return a.exec();
General Comments 0
You need to be logged in to leave comments. Login now