@@ -12,9 +12,9 int main(int argc, char *argv[]) | |||||
12 | QApplication a(argc, argv); |
|
12 | QApplication a(argc, argv); | |
13 |
|
13 | |||
14 | // Create widget and scatter series |
|
14 | // Create widget and scatter series | |
15 | QChartWidget chartWidget; |
|
15 | QChartWidget *chartWidget = new QChartWidget(); | |
16 | QScatterSeries *scatter = |
|
16 | QScatterSeries *scatter = | |
17 |
qobject_cast<QScatterSeries *>(chartWidget |
|
17 | qobject_cast<QScatterSeries *>(chartWidget->createSeries(QChartSeries::SeriesTypeScatter)); | |
18 | Q_ASSERT(scatter); |
|
18 | Q_ASSERT(scatter); | |
19 |
|
19 | |||
20 | // Add test data to the series |
|
20 | // Add test data to the series | |
@@ -30,7 +30,7 int main(int argc, char *argv[]) | |||||
30 | // Use the chart widget as the central widget |
|
30 | // Use the chart widget as the central widget | |
31 | QMainWindow w; |
|
31 | QMainWindow w; | |
32 | w.resize(640, 480); |
|
32 | w.resize(640, 480); | |
33 |
w.setCentralWidget( |
|
33 | w.setCentralWidget(chartWidget); | |
34 | w.show(); |
|
34 | w.show(); | |
35 |
|
35 | |||
36 | return a.exec(); |
|
36 | return a.exec(); |
General Comments 0
You need to be logged in to leave comments.
Login now