##// END OF EJS Templates
Make scatterinteractions compile
Jani Honkonen -
r831:d1edc6bf68da
parent child
Show More
@@ -1,29 +1,29
1 1 TEMPLATE = subdirs
2 2 SUBDIRS += \
3 3 areachart \
4 4 barchart \
5 5 #chartview \
6 6 customchart \
7 7 #dynamiclinechart \
8 8 #ekgchart \
9 9 linechart \
10 10 #multichart \
11 11 percentbarchart \
12 12 piechart \
13 13 piechartdrilldown \
14 14 #presenterchart \
15 15 scatterchart \
16 #scatterinteractions \
16 scatterinteractions \
17 17 #splinechart \
18 18 stackedbarchart \
19 19 stackedbarchartdrilldown \
20 20 #tablemodelchart \
21 21 zoomlinechart
22 22
23 23
24 24
25 25
26 26
27 27
28 28
29 29
@@ -1,58 +1,57
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 #include "mainwindow.h"
22 #include <qchartglobal.h>
23 #include <qchartview.h>
24 #include <qchartaxis.h>
25 #include <QDebug>
22 #include <QChartView>
26 23
27 24 QTCOMMERCIALCHART_USE_NAMESPACE
28 25
29 26 MainWindow::MainWindow(QWidget *parent)
30 27 : QMainWindow(parent)
31 28 {
32 QChartView *chartView = new QChartView(this);
33 chartView->setChartTitle("Click to remove scatter point");
34 chartView->setRenderHint(QPainter::Antialiasing);
35 setCentralWidget(chartView);
29 QChart *chart = new QChart();
30 chart->setTitle("Click to remove scatter point");
36 31
37 32 m_scatter = new QScatterSeries();
38 33 for(qreal x(0.5); x <= 4.0; x += 0.5) {
39 34 for(qreal y(0.5); y <= 4.0; y += 0.5) {
40 35 *m_scatter << QPointF(x, y);
41 36 }
42 37 }
43 38
44 chartView->addSeries(m_scatter);
45 chartView->axisX()->setRange(0,4.5);
46 chartView->axisY()->setRange(0,4.5);
39 chart->addSeries(m_scatter);
40 chart->axisX()->setRange(0, 4.5);
41 chart->axisY()->setRange(0, 4.5);
47 42
48 43 connect(m_scatter, SIGNAL(clicked(const QPointF&)), this, SLOT(handleClickedPoint(const QPointF&)));
44
45 QChartView *chartView = new QChartView(chart);
46 chartView->setRenderHint(QPainter::Antialiasing);
47 setCentralWidget(chartView);
49 48 }
50 49
51 50 MainWindow::~MainWindow()
52 51 {
53 52 }
54 53
55 54 void MainWindow::handleClickedPoint(const QPointF& point)
56 55 {
57 56 m_scatter->remove(point);
58 57 }
General Comments 0
You need to be logged in to leave comments. Login now