@@ -0,0 +1,18 | |||
|
1 | TEMPLATE = subdirs | |
|
2 | SUBDIRS += \ | |
|
3 | presenterchart \ | |
|
4 | polarcharttest \ | |
|
5 | boxplottester | |
|
6 | ||
|
7 | contains(QT_CONFIG, opengl) { | |
|
8 | SUBDIRS += chartwidgettest \ | |
|
9 | wavechart \ | |
|
10 | chartviewer | |
|
11 | } else { | |
|
12 | message("OpenGL not available. Some test apps are disabled") | |
|
13 | } | |
|
14 | ||
|
15 | qtHaveModule(quick) { | |
|
16 | SUBDIRS += qmlchartproperties \ | |
|
17 | qmlchartaxis | |
|
18 | } |
@@ -2,5 +2,4 | |||
|
2 | 2 | .gitignore export-ignore |
|
3 | 3 | .gitattributes export-ignore |
|
4 | 4 | .commit-template export-ignore |
|
5 | tests export-ignore | |
|
6 | 5 | tools export-ignore |
@@ -1,4 +1,4 | |||
|
1 | !include( ../tests.pri ) { | |
|
1 | !include( ../../tests.pri ) { | |
|
2 | 2 | error( "Couldn't find the test.pri file!" ) |
|
3 | 3 | } |
|
4 | 4 |
|
1 | NO CONTENT: file renamed from tests/boxplottester/customtablemodel.cpp to tests/manual/boxplottester/customtablemodel.cpp |
|
1 | NO CONTENT: file renamed from tests/boxplottester/customtablemodel.h to tests/manual/boxplottester/customtablemodel.h |
|
1 | NO CONTENT: file renamed from tests/boxplottester/main.cpp to tests/manual/boxplottester/main.cpp |
|
1 | NO CONTENT: file renamed from tests/boxplottester/mainwidget.cpp to tests/manual/boxplottester/mainwidget.cpp |
|
1 | NO CONTENT: file renamed from tests/boxplottester/mainwidget.h to tests/manual/boxplottester/mainwidget.h |
|
1 | NO CONTENT: file renamed from tests/boxplottester/pentool.cpp to tests/manual/boxplottester/pentool.cpp |
|
1 | NO CONTENT: file renamed from tests/boxplottester/pentool.h to tests/manual/boxplottester/pentool.h |
|
1 | NO CONTENT: file renamed from tests/chartdesigner/brushwidget.cpp to tests/manual/chartdesigner/brushwidget.cpp |
|
1 | NO CONTENT: file renamed from tests/chartdesigner/brushwidget.h to tests/manual/chartdesigner/brushwidget.h |
|
1 | NO CONTENT: file renamed from tests/chartdesigner/chartdesigner.pro to tests/manual/chartdesigner/chartdesigner.pro |
|
1 | NO CONTENT: file renamed from tests/chartdesigner/engine.cpp to tests/manual/chartdesigner/engine.cpp |
|
1 | NO CONTENT: file renamed from tests/chartdesigner/engine.h to tests/manual/chartdesigner/engine.h |
|
1 | NO CONTENT: file renamed from tests/chartdesigner/main.cpp to tests/manual/chartdesigner/main.cpp |
|
1 | NO CONTENT: file renamed from tests/chartdesigner/mainwindow.cpp to tests/manual/chartdesigner/mainwindow.cpp |
|
1 | NO CONTENT: file renamed from tests/chartdesigner/mainwindow.h to tests/manual/chartdesigner/mainwindow.h |
|
1 | NO CONTENT: file renamed from tests/chartdesigner/objectinspectorwidget.cpp to tests/manual/chartdesigner/objectinspectorwidget.cpp |
|
1 | NO CONTENT: file renamed from tests/chartdesigner/objectinspectorwidget.h to tests/manual/chartdesigner/objectinspectorwidget.h |
|
1 | NO CONTENT: file renamed from tests/chartdesigner/penwidget.cpp to tests/manual/chartdesigner/penwidget.cpp |
|
1 | NO CONTENT: file renamed from tests/chartdesigner/penwidget.h to tests/manual/chartdesigner/penwidget.h |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts.h to tests/manual/chartviewer/charts.h |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/axis/barcategoryaxisx.cpp to tests/manual/chartviewer/charts/axis/barcategoryaxisx.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/axis/barcategoryaxisxlogy.cpp to tests/manual/chartviewer/charts/axis/barcategoryaxisxlogy.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/axis/barcategoryaxisy.cpp to tests/manual/chartviewer/charts/axis/barcategoryaxisy.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/axis/barcategoryaxisylogx.cpp to tests/manual/chartviewer/charts/axis/barcategoryaxisylogx.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/axis/categoryaxis.cpp to tests/manual/chartviewer/charts/axis/categoryaxis.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/axis/datetimeaxisx.cpp to tests/manual/chartviewer/charts/axis/datetimeaxisx.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/axis/datetimeaxisy.cpp to tests/manual/chartviewer/charts/axis/datetimeaxisy.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/axis/logvalueaxisx.cpp to tests/manual/chartviewer/charts/axis/logvalueaxisx.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/axis/logvalueaxisy.cpp to tests/manual/chartviewer/charts/axis/logvalueaxisy.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/axis/valueaxis.cpp to tests/manual/chartviewer/charts/axis/valueaxis.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/barseries/horizontalbarchart.cpp to tests/manual/chartviewer/charts/barseries/horizontalbarchart.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/barseries/horizontalpercentbarchart.cpp to tests/manual/chartviewer/charts/barseries/horizontalpercentbarchart.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/barseries/horizontalstackedbarchart.cpp to tests/manual/chartviewer/charts/barseries/horizontalstackedbarchart.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/barseries/verticalbarchart.cpp to tests/manual/chartviewer/charts/barseries/verticalbarchart.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/barseries/verticalpercentbarchart.cpp to tests/manual/chartviewer/charts/barseries/verticalpercentbarchart.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/barseries/verticalstackedbarchart.cpp to tests/manual/chartviewer/charts/barseries/verticalstackedbarchart.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/charts.pri to tests/manual/chartviewer/charts/charts.pri |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/domain/barlogx.cpp to tests/manual/chartviewer/charts/domain/barlogx.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/domain/barlogy.cpp to tests/manual/chartviewer/charts/domain/barlogy.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/domain/barpercentlogx.cpp to tests/manual/chartviewer/charts/domain/barpercentlogx.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/domain/barpercentlogy.cpp to tests/manual/chartviewer/charts/domain/barpercentlogy.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/domain/barstackedlogx.cpp to tests/manual/chartviewer/charts/domain/barstackedlogx.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/domain/barstackedlogy.cpp to tests/manual/chartviewer/charts/domain/barstackedlogy.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/domain/linelogxlogy.cpp to tests/manual/chartviewer/charts/domain/linelogxlogy.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/domain/linelogxy.cpp to tests/manual/chartviewer/charts/domain/linelogxy.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/domain/linexlogy.cpp to tests/manual/chartviewer/charts/domain/linexlogy.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/domain/scatterlogxlogy.cpp to tests/manual/chartviewer/charts/domain/scatterlogxlogy.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/domain/scatterlogxy.cpp to tests/manual/chartviewer/charts/domain/scatterlogxy.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/domain/scatterxlogy.cpp to tests/manual/chartviewer/charts/domain/scatterxlogy.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/domain/splinelogxlogy.cpp to tests/manual/chartviewer/charts/domain/splinelogxlogy.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/domain/splinelogxy.cpp to tests/manual/chartviewer/charts/domain/splinelogxy.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/domain/splinexlogy.cpp to tests/manual/chartviewer/charts/domain/splinexlogy.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/font/font.cpp to tests/manual/chartviewer/charts/font/font.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/multiaxis/multivalueaxis.cpp to tests/manual/chartviewer/charts/multiaxis/multivalueaxis.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/multiaxis/multivalueaxis2.cpp to tests/manual/chartviewer/charts/multiaxis/multivalueaxis2.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/multiaxis/multivalueaxis3.cpp to tests/manual/chartviewer/charts/multiaxis/multivalueaxis3.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/multiaxis/multivalueaxis4.cpp to tests/manual/chartviewer/charts/multiaxis/multivalueaxis4.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/multiaxis/multivaluebaraxis.cpp to tests/manual/chartviewer/charts/multiaxis/multivaluebaraxis.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/pieseries/donutchart.cpp to tests/manual/chartviewer/charts/pieseries/donutchart.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/pieseries/piechart.cpp to tests/manual/chartviewer/charts/pieseries/piechart.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/size/sizecharts.cpp to tests/manual/chartviewer/charts/size/sizecharts.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/xyseries/areachart.cpp to tests/manual/chartviewer/charts/xyseries/areachart.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/xyseries/linechart.cpp to tests/manual/chartviewer/charts/xyseries/linechart.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/xyseries/scatterchart.cpp to tests/manual/chartviewer/charts/xyseries/scatterchart.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/charts/xyseries/splinechart.cpp to tests/manual/chartviewer/charts/xyseries/splinechart.cpp |
@@ -1,4 +1,6 | |||
|
1 | !include( ../tests.pri ):error( "Couldn't find the tests.pri file!" ) | |
|
1 | !include( ../../tests.pri ) { | |
|
2 | error( "Couldn't find the test.pri file!" ) | |
|
3 | } | |
|
2 | 4 | include(charts/charts.pri) |
|
3 | 5 | TARGET = chartviewer |
|
4 | 6 | QT += opengl |
|
1 | NO CONTENT: file renamed from tests/chartviewer/grid.cpp to tests/manual/chartviewer/grid.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/grid.h to tests/manual/chartviewer/grid.h |
|
1 | NO CONTENT: file renamed from tests/chartviewer/main.cpp to tests/manual/chartviewer/main.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/model.h to tests/manual/chartviewer/model.h |
|
1 | NO CONTENT: file renamed from tests/chartviewer/view.cpp to tests/manual/chartviewer/view.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/view.h to tests/manual/chartviewer/view.h |
|
1 | NO CONTENT: file renamed from tests/chartviewer/window.cpp to tests/manual/chartviewer/window.cpp |
|
1 | NO CONTENT: file renamed from tests/chartviewer/window.h to tests/manual/chartviewer/window.h |
@@ -1,4 +1,4 | |||
|
1 | !include( ../tests.pri ) { | |
|
1 | !include( ../../tests.pri ) { | |
|
2 | 2 | error( "Couldn't find the test.pri file!" ) |
|
3 | 3 | } |
|
4 | 4 |
@@ -1,189 +1,189 | |||
|
1 | /**************************************************************************** | |
|
2 | ** | |
|
3 | ** Copyright (C) 2014 Digia Plc | |
|
4 | ** All rights reserved. | |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
|
6 | ** | |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
|
8 | ** | |
|
9 | ** $QT_BEGIN_LICENSE$ | |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
|
13 | ** a written agreement between you and Digia. | |
|
14 | ** | |
|
15 | ** If you have questions regarding the use of this file, please use | |
|
16 | ** contact form at http://qt.digia.com | |
|
17 | ** $QT_END_LICENSE$ | |
|
18 | ** | |
|
19 | ****************************************************************************/ | |
|
20 | ||
|
21 | #include "dataseriedialog.h" | |
|
22 | #include <QtWidgets/QDialogButtonBox> | |
|
23 | #include <QtWidgets/QGridLayout> | |
|
24 | #include <QtWidgets/QCheckBox> | |
|
25 | #include <QtWidgets/QPushButton> | |
|
26 | #include <QtWidgets/QGroupBox> | |
|
27 | #include <QtWidgets/QRadioButton> | |
|
28 | #include <QtWidgets/QLabel> | |
|
29 | #include <QtCore/QDebug> | |
|
30 | ||
|
31 | DataSerieDialog::DataSerieDialog(QWidget *parent) : | |
|
32 | QDialog(parent) | |
|
33 | { | |
|
34 | QDialogButtonBox *addSeriesBox = new QDialogButtonBox(Qt::Horizontal); | |
|
35 | QPushButton *b = addSeriesBox->addButton(QDialogButtonBox::Ok); | |
|
36 | connect(b, SIGNAL(clicked()), this, SLOT(accept())); | |
|
37 | b = addSeriesBox->addButton(QDialogButtonBox::Cancel); | |
|
38 | connect(b, SIGNAL(clicked()), this, SLOT(reject())); | |
|
39 | ||
|
40 | QGridLayout *grid = new QGridLayout(); | |
|
41 | ||
|
42 | m_seriesTypeSelector = seriesTypeSelector(); | |
|
43 | m_columnCountSelector = columnCountSelector(); | |
|
44 | m_rowCountSelector = rowCountSelector(); | |
|
45 | m_dataCharacteristicsSelector = dataCharacteristicsSelector(); | |
|
46 | ||
|
47 | grid->addWidget(m_seriesTypeSelector, 0, 0); | |
|
48 | grid->addWidget(m_columnCountSelector, 0, 1); | |
|
49 | grid->addWidget(m_rowCountSelector, 1, 1); | |
|
50 | grid->addWidget(m_dataCharacteristicsSelector, 1, 0); | |
|
51 | m_labelsSelector = new QCheckBox("Labels defined"); | |
|
52 | m_labelsSelector->setChecked(true); | |
|
53 | grid->addWidget(m_labelsSelector, 2, 0); | |
|
54 | grid->addWidget(addSeriesBox, 3, 1); | |
|
55 | ||
|
56 | setLayout(grid); | |
|
57 | } | |
|
58 | ||
|
59 | QGroupBox *DataSerieDialog::seriesTypeSelector() | |
|
60 | { | |
|
61 | QVBoxLayout *layout = new QVBoxLayout(); | |
|
62 | ||
|
63 | QRadioButton *line = new QRadioButton("Line"); | |
|
64 | line->setChecked(true); | |
|
65 | layout->addWidget(line); | |
|
66 | layout->addWidget(new QRadioButton("Area")); | |
|
67 | layout->addWidget(new QRadioButton("Pie")); | |
|
68 | layout->addWidget(new QRadioButton("Bar")); | |
|
69 | layout->addWidget(new QRadioButton("Stacked bar")); | |
|
70 | layout->addWidget(new QRadioButton("Percent bar")); | |
|
71 | layout->addWidget(new QRadioButton("Scatter")); | |
|
72 | layout->addWidget(new QRadioButton("Spline")); | |
|
73 | ||
|
74 | QGroupBox *groupBox = new QGroupBox("Series type"); | |
|
75 | groupBox->setLayout(layout); | |
|
76 | selectRadio(groupBox, 0); | |
|
77 | ||
|
78 | return groupBox; | |
|
79 | } | |
|
80 | ||
|
81 | QGroupBox *DataSerieDialog::columnCountSelector() | |
|
82 | { | |
|
83 | QVBoxLayout *layout = new QVBoxLayout(); | |
|
84 | ||
|
85 | QRadioButton *radio = new QRadioButton("1"); | |
|
86 | radio->setChecked(true); | |
|
87 | layout->addWidget(radio); | |
|
88 | layout->addWidget(new QRadioButton("2")); | |
|
89 | layout->addWidget(new QRadioButton("3")); | |
|
90 | layout->addWidget(new QRadioButton("4")); | |
|
91 | layout->addWidget(new QRadioButton("5")); | |
|
92 | layout->addWidget(new QRadioButton("8")); | |
|
93 | layout->addWidget(new QRadioButton("10")); | |
|
94 | layout->addWidget(new QRadioButton("100")); | |
|
95 | ||
|
96 | QGroupBox *groupBox = new QGroupBox("Column count"); | |
|
97 | groupBox->setLayout(layout); | |
|
98 | selectRadio(groupBox, 0); | |
|
99 | ||
|
100 | return groupBox; | |
|
101 | } | |
|
102 | ||
|
103 | QGroupBox *DataSerieDialog::rowCountSelector() | |
|
104 | { | |
|
105 | QVBoxLayout *layout = new QVBoxLayout(); | |
|
106 | ||
|
107 | layout->addWidget(new QRadioButton("1")); | |
|
108 | QRadioButton *radio = new QRadioButton("10"); | |
|
109 | radio->setChecked(true); | |
|
110 | layout->addWidget(radio); | |
|
111 | layout->addWidget(new QRadioButton("50")); | |
|
112 | layout->addWidget(new QRadioButton("100")); | |
|
113 | layout->addWidget(new QRadioButton("1000")); | |
|
114 | layout->addWidget(new QRadioButton("10000")); | |
|
115 | layout->addWidget(new QRadioButton("100000")); | |
|
116 | layout->addWidget(new QRadioButton("1000000")); | |
|
117 | ||
|
118 | QGroupBox *groupBox = new QGroupBox("Row count"); | |
|
119 | groupBox->setLayout(layout); | |
|
120 | selectRadio(groupBox, 0); | |
|
121 | ||
|
122 | return groupBox; | |
|
123 | } | |
|
124 | ||
|
125 | QGroupBox *DataSerieDialog::dataCharacteristicsSelector() | |
|
126 | { | |
|
127 | QVBoxLayout *layout = new QVBoxLayout(); | |
|
128 | ||
|
129 | layout->addWidget(new QRadioButton("Linear")); | |
|
130 | layout->addWidget(new QRadioButton("Constant")); | |
|
131 | layout->addWidget(new QRadioButton("Random")); | |
|
132 | layout->addWidget(new QRadioButton("Sin")); | |
|
133 | layout->addWidget(new QRadioButton("Sin + random")); | |
|
134 | ||
|
135 | QGroupBox *groupBox = new QGroupBox("Data Characteristics"); | |
|
136 | groupBox->setLayout(layout); | |
|
137 | selectRadio(groupBox, 0); | |
|
138 | ||
|
139 | return groupBox; | |
|
140 | } | |
|
141 | ||
|
142 | void DataSerieDialog::accept() | |
|
143 | { | |
|
144 | accepted(radioSelection(m_seriesTypeSelector), | |
|
145 | radioSelection(m_columnCountSelector).toInt(), | |
|
146 | radioSelection(m_rowCountSelector).toInt(), | |
|
147 | radioSelection(m_dataCharacteristicsSelector), | |
|
148 | m_labelsSelector->isChecked()); | |
|
149 | QDialog::accept(); | |
|
150 | } | |
|
151 | ||
|
152 | void DataSerieDialog::selectRadio(QGroupBox *groupBox, int defaultSelection) | |
|
153 | { | |
|
154 | QVBoxLayout *layout = qobject_cast<QVBoxLayout *>(groupBox->layout()); | |
|
155 | Q_ASSERT(layout); | |
|
156 | Q_ASSERT(layout->count()); | |
|
157 | ||
|
158 | QLayoutItem *item = 0; | |
|
159 | if (defaultSelection == -1) { | |
|
160 | item = layout->itemAt(0); | |
|
161 | } else if (layout->count() > defaultSelection) { | |
|
162 | item = layout->itemAt(defaultSelection); | |
|
163 | } | |
|
164 | Q_ASSERT(item); | |
|
165 | QRadioButton *radio = qobject_cast<QRadioButton *>(item->widget()); | |
|
166 | Q_ASSERT(radio); | |
|
167 | radio->setChecked(true); | |
|
168 | } | |
|
169 | ||
|
170 | QString DataSerieDialog::radioSelection(QGroupBox *groupBox) | |
|
171 | { | |
|
172 | QString selection; | |
|
173 | QVBoxLayout *layout = qobject_cast<QVBoxLayout *>(groupBox->layout()); | |
|
174 | Q_ASSERT(layout); | |
|
175 | ||
|
176 | for (int i(0); i < layout->count(); i++) { | |
|
177 | QLayoutItem *item = layout->itemAt(i); | |
|
178 | Q_ASSERT(item); | |
|
179 | QRadioButton *radio = qobject_cast<QRadioButton *>(item->widget()); | |
|
180 | Q_ASSERT(radio); | |
|
181 | if (radio->isChecked()) { | |
|
182 | selection = radio->text(); | |
|
183 | break; | |
|
184 | } | |
|
185 | } | |
|
186 | ||
|
187 | qDebug() << "radioSelection: " << selection; | |
|
188 | return selection; | |
|
189 | } | |
|
1 | /**************************************************************************** | |
|
2 | ** | |
|
3 | ** Copyright (C) 2014 Digia Plc | |
|
4 | ** All rights reserved. | |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
|
6 | ** | |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
|
8 | ** | |
|
9 | ** $QT_BEGIN_LICENSE$ | |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
|
13 | ** a written agreement between you and Digia. | |
|
14 | ** | |
|
15 | ** If you have questions regarding the use of this file, please use | |
|
16 | ** contact form at http://qt.digia.com | |
|
17 | ** $QT_END_LICENSE$ | |
|
18 | ** | |
|
19 | ****************************************************************************/ | |
|
20 | ||
|
21 | #include "dataseriedialog.h" | |
|
22 | #include <QtWidgets/QDialogButtonBox> | |
|
23 | #include <QtWidgets/QGridLayout> | |
|
24 | #include <QtWidgets/QCheckBox> | |
|
25 | #include <QtWidgets/QPushButton> | |
|
26 | #include <QtWidgets/QGroupBox> | |
|
27 | #include <QtWidgets/QRadioButton> | |
|
28 | #include <QtWidgets/QLabel> | |
|
29 | #include <QtCore/QDebug> | |
|
30 | ||
|
31 | DataSerieDialog::DataSerieDialog(QWidget *parent) : | |
|
32 | QDialog(parent) | |
|
33 | { | |
|
34 | QDialogButtonBox *addSeriesBox = new QDialogButtonBox(Qt::Horizontal); | |
|
35 | QPushButton *b = addSeriesBox->addButton(QDialogButtonBox::Ok); | |
|
36 | connect(b, SIGNAL(clicked()), this, SLOT(accept())); | |
|
37 | b = addSeriesBox->addButton(QDialogButtonBox::Cancel); | |
|
38 | connect(b, SIGNAL(clicked()), this, SLOT(reject())); | |
|
39 | ||
|
40 | QGridLayout *grid = new QGridLayout(); | |
|
41 | ||
|
42 | m_seriesTypeSelector = seriesTypeSelector(); | |
|
43 | m_columnCountSelector = columnCountSelector(); | |
|
44 | m_rowCountSelector = rowCountSelector(); | |
|
45 | m_dataCharacteristicsSelector = dataCharacteristicsSelector(); | |
|
46 | ||
|
47 | grid->addWidget(m_seriesTypeSelector, 0, 0); | |
|
48 | grid->addWidget(m_columnCountSelector, 0, 1); | |
|
49 | grid->addWidget(m_rowCountSelector, 1, 1); | |
|
50 | grid->addWidget(m_dataCharacteristicsSelector, 1, 0); | |
|
51 | m_labelsSelector = new QCheckBox("Labels defined"); | |
|
52 | m_labelsSelector->setChecked(true); | |
|
53 | grid->addWidget(m_labelsSelector, 2, 0); | |
|
54 | grid->addWidget(addSeriesBox, 3, 1); | |
|
55 | ||
|
56 | setLayout(grid); | |
|
57 | } | |
|
58 | ||
|
59 | QGroupBox *DataSerieDialog::seriesTypeSelector() | |
|
60 | { | |
|
61 | QVBoxLayout *layout = new QVBoxLayout(); | |
|
62 | ||
|
63 | QRadioButton *line = new QRadioButton("Line"); | |
|
64 | line->setChecked(true); | |
|
65 | layout->addWidget(line); | |
|
66 | layout->addWidget(new QRadioButton("Area")); | |
|
67 | layout->addWidget(new QRadioButton("Pie")); | |
|
68 | layout->addWidget(new QRadioButton("Bar")); | |
|
69 | layout->addWidget(new QRadioButton("Stacked bar")); | |
|
70 | layout->addWidget(new QRadioButton("Percent bar")); | |
|
71 | layout->addWidget(new QRadioButton("Scatter")); | |
|
72 | layout->addWidget(new QRadioButton("Spline")); | |
|
73 | ||
|
74 | QGroupBox *groupBox = new QGroupBox("Series type"); | |
|
75 | groupBox->setLayout(layout); | |
|
76 | selectRadio(groupBox, 0); | |
|
77 | ||
|
78 | return groupBox; | |
|
79 | } | |
|
80 | ||
|
81 | QGroupBox *DataSerieDialog::columnCountSelector() | |
|
82 | { | |
|
83 | QVBoxLayout *layout = new QVBoxLayout(); | |
|
84 | ||
|
85 | QRadioButton *radio = new QRadioButton("1"); | |
|
86 | radio->setChecked(true); | |
|
87 | layout->addWidget(radio); | |
|
88 | layout->addWidget(new QRadioButton("2")); | |
|
89 | layout->addWidget(new QRadioButton("3")); | |
|
90 | layout->addWidget(new QRadioButton("4")); | |
|
91 | layout->addWidget(new QRadioButton("5")); | |
|
92 | layout->addWidget(new QRadioButton("8")); | |
|
93 | layout->addWidget(new QRadioButton("10")); | |
|
94 | layout->addWidget(new QRadioButton("100")); | |
|
95 | ||
|
96 | QGroupBox *groupBox = new QGroupBox("Column count"); | |
|
97 | groupBox->setLayout(layout); | |
|
98 | selectRadio(groupBox, 0); | |
|
99 | ||
|
100 | return groupBox; | |
|
101 | } | |
|
102 | ||
|
103 | QGroupBox *DataSerieDialog::rowCountSelector() | |
|
104 | { | |
|
105 | QVBoxLayout *layout = new QVBoxLayout(); | |
|
106 | ||
|
107 | layout->addWidget(new QRadioButton("1")); | |
|
108 | QRadioButton *radio = new QRadioButton("10"); | |
|
109 | radio->setChecked(true); | |
|
110 | layout->addWidget(radio); | |
|
111 | layout->addWidget(new QRadioButton("50")); | |
|
112 | layout->addWidget(new QRadioButton("100")); | |
|
113 | layout->addWidget(new QRadioButton("1000")); | |
|
114 | layout->addWidget(new QRadioButton("10000")); | |
|
115 | layout->addWidget(new QRadioButton("100000")); | |
|
116 | layout->addWidget(new QRadioButton("1000000")); | |
|
117 | ||
|
118 | QGroupBox *groupBox = new QGroupBox("Row count"); | |
|
119 | groupBox->setLayout(layout); | |
|
120 | selectRadio(groupBox, 0); | |
|
121 | ||
|
122 | return groupBox; | |
|
123 | } | |
|
124 | ||
|
125 | QGroupBox *DataSerieDialog::dataCharacteristicsSelector() | |
|
126 | { | |
|
127 | QVBoxLayout *layout = new QVBoxLayout(); | |
|
128 | ||
|
129 | layout->addWidget(new QRadioButton("Linear")); | |
|
130 | layout->addWidget(new QRadioButton("Constant")); | |
|
131 | layout->addWidget(new QRadioButton("Random")); | |
|
132 | layout->addWidget(new QRadioButton("Sin")); | |
|
133 | layout->addWidget(new QRadioButton("Sin + random")); | |
|
134 | ||
|
135 | QGroupBox *groupBox = new QGroupBox("Data Characteristics"); | |
|
136 | groupBox->setLayout(layout); | |
|
137 | selectRadio(groupBox, 0); | |
|
138 | ||
|
139 | return groupBox; | |
|
140 | } | |
|
141 | ||
|
142 | void DataSerieDialog::accept() | |
|
143 | { | |
|
144 | accepted(radioSelection(m_seriesTypeSelector), | |
|
145 | radioSelection(m_columnCountSelector).toInt(), | |
|
146 | radioSelection(m_rowCountSelector).toInt(), | |
|
147 | radioSelection(m_dataCharacteristicsSelector), | |
|
148 | m_labelsSelector->isChecked()); | |
|
149 | QDialog::accept(); | |
|
150 | } | |
|
151 | ||
|
152 | void DataSerieDialog::selectRadio(QGroupBox *groupBox, int defaultSelection) | |
|
153 | { | |
|
154 | QVBoxLayout *layout = qobject_cast<QVBoxLayout *>(groupBox->layout()); | |
|
155 | Q_ASSERT(layout); | |
|
156 | Q_ASSERT(layout->count()); | |
|
157 | ||
|
158 | QLayoutItem *item = 0; | |
|
159 | if (defaultSelection == -1) { | |
|
160 | item = layout->itemAt(0); | |
|
161 | } else if (layout->count() > defaultSelection) { | |
|
162 | item = layout->itemAt(defaultSelection); | |
|
163 | } | |
|
164 | Q_ASSERT(item); | |
|
165 | QRadioButton *radio = qobject_cast<QRadioButton *>(item->widget()); | |
|
166 | Q_ASSERT(radio); | |
|
167 | radio->setChecked(true); | |
|
168 | } | |
|
169 | ||
|
170 | QString DataSerieDialog::radioSelection(QGroupBox *groupBox) | |
|
171 | { | |
|
172 | QString selection; | |
|
173 | QVBoxLayout *layout = qobject_cast<QVBoxLayout *>(groupBox->layout()); | |
|
174 | Q_ASSERT(layout); | |
|
175 | ||
|
176 | for (int i(0); i < layout->count(); i++) { | |
|
177 | QLayoutItem *item = layout->itemAt(i); | |
|
178 | Q_ASSERT(item); | |
|
179 | QRadioButton *radio = qobject_cast<QRadioButton *>(item->widget()); | |
|
180 | Q_ASSERT(radio); | |
|
181 | if (radio->isChecked()) { | |
|
182 | selection = radio->text(); | |
|
183 | break; | |
|
184 | } | |
|
185 | } | |
|
186 | ||
|
187 | qDebug() << "radioSelection: " << selection; | |
|
188 | return selection; | |
|
189 | } |
@@ -1,55 +1,55 | |||
|
1 | /**************************************************************************** | |
|
2 | ** | |
|
3 | ** Copyright (C) 2014 Digia Plc | |
|
4 | ** All rights reserved. | |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
|
6 | ** | |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
|
8 | ** | |
|
9 | ** $QT_BEGIN_LICENSE$ | |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
|
13 | ** a written agreement between you and Digia. | |
|
14 | ** | |
|
15 | ** If you have questions regarding the use of this file, please use | |
|
16 | ** contact form at http://qt.digia.com | |
|
17 | ** $QT_END_LICENSE$ | |
|
18 | ** | |
|
19 | ****************************************************************************/ | |
|
20 | ||
|
21 | #ifndef DATASERIEDIALOG_H | |
|
22 | #define DATASERIEDIALOG_H | |
|
23 | ||
|
24 | #include <QtWidgets/QDialog> | |
|
25 | ||
|
26 | class QGroupBox; | |
|
27 | class QCheckBox; | |
|
28 | ||
|
29 | class DataSerieDialog : public QDialog | |
|
30 | { | |
|
31 | Q_OBJECT | |
|
32 | public: | |
|
33 | explicit DataSerieDialog(QWidget *parent = 0); | |
|
34 | ||
|
35 | signals: | |
|
36 | void accepted(QString series, int columnCount, int rowCount, QString dataCharacteristics, bool labelsDefined); | |
|
37 | ||
|
38 | public slots: | |
|
39 | void accept(); | |
|
40 | ||
|
41 | private: | |
|
42 | QGroupBox *seriesTypeSelector(); | |
|
43 | QGroupBox *columnCountSelector(); | |
|
44 | QGroupBox *rowCountSelector(); | |
|
45 | QGroupBox *dataCharacteristicsSelector(); | |
|
46 | void selectRadio(QGroupBox *groupBox, int defaultSelection); | |
|
47 | QString radioSelection(QGroupBox *groupBox); | |
|
48 | QGroupBox *m_seriesTypeSelector; | |
|
49 | QGroupBox *m_columnCountSelector; | |
|
50 | QGroupBox *m_rowCountSelector; | |
|
51 | QCheckBox *m_labelsSelector; | |
|
52 | QGroupBox *m_dataCharacteristicsSelector; | |
|
53 | }; | |
|
54 | ||
|
55 | #endif // DATASERIEDIALOG_H | |
|
1 | /**************************************************************************** | |
|
2 | ** | |
|
3 | ** Copyright (C) 2014 Digia Plc | |
|
4 | ** All rights reserved. | |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
|
6 | ** | |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
|
8 | ** | |
|
9 | ** $QT_BEGIN_LICENSE$ | |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
|
13 | ** a written agreement between you and Digia. | |
|
14 | ** | |
|
15 | ** If you have questions regarding the use of this file, please use | |
|
16 | ** contact form at http://qt.digia.com | |
|
17 | ** $QT_END_LICENSE$ | |
|
18 | ** | |
|
19 | ****************************************************************************/ | |
|
20 | ||
|
21 | #ifndef DATASERIEDIALOG_H | |
|
22 | #define DATASERIEDIALOG_H | |
|
23 | ||
|
24 | #include <QtWidgets/QDialog> | |
|
25 | ||
|
26 | class QGroupBox; | |
|
27 | class QCheckBox; | |
|
28 | ||
|
29 | class DataSerieDialog : public QDialog | |
|
30 | { | |
|
31 | Q_OBJECT | |
|
32 | public: | |
|
33 | explicit DataSerieDialog(QWidget *parent = 0); | |
|
34 | ||
|
35 | signals: | |
|
36 | void accepted(QString series, int columnCount, int rowCount, QString dataCharacteristics, bool labelsDefined); | |
|
37 | ||
|
38 | public slots: | |
|
39 | void accept(); | |
|
40 | ||
|
41 | private: | |
|
42 | QGroupBox *seriesTypeSelector(); | |
|
43 | QGroupBox *columnCountSelector(); | |
|
44 | QGroupBox *rowCountSelector(); | |
|
45 | QGroupBox *dataCharacteristicsSelector(); | |
|
46 | void selectRadio(QGroupBox *groupBox, int defaultSelection); | |
|
47 | QString radioSelection(QGroupBox *groupBox); | |
|
48 | QGroupBox *m_seriesTypeSelector; | |
|
49 | QGroupBox *m_columnCountSelector; | |
|
50 | QGroupBox *m_rowCountSelector; | |
|
51 | QCheckBox *m_labelsSelector; | |
|
52 | QGroupBox *m_dataCharacteristicsSelector; | |
|
53 | }; | |
|
54 | ||
|
55 | #endif // DATASERIEDIALOG_H |
|
1 | NO CONTENT: file renamed from tests/chartwidgettest/main.cpp to tests/manual/chartwidgettest/main.cpp |
This diff has been collapsed as it changes many lines, (760 lines changed) Show them Hide them | |||
@@ -1,380 +1,380 | |||
|
1 | /**************************************************************************** | |
|
2 | ** | |
|
3 | ** Copyright (C) 2014 Digia Plc | |
|
4 | ** All rights reserved. | |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
|
6 | ** | |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
|
8 | ** | |
|
9 | ** $QT_BEGIN_LICENSE$ | |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
|
13 | ** a written agreement between you and Digia. | |
|
14 | ** | |
|
15 | ** If you have questions regarding the use of this file, please use | |
|
16 | ** contact form at http://qt.digia.com | |
|
17 | ** $QT_END_LICENSE$ | |
|
18 | ** | |
|
19 | ****************************************************************************/ | |
|
20 | ||
|
21 | #include "mainwidget.h" | |
|
22 | #include "dataseriedialog.h" | |
|
23 | #include <QtCharts/QChartView> | |
|
24 | #include <QtCharts/QPieSeries> | |
|
25 | #include <QtCharts/QScatterSeries> | |
|
26 | #include <QtCharts/QLineSeries> | |
|
27 | #include <QtCharts/QAreaSeries> | |
|
28 | #include <QtCharts/QSplineSeries> | |
|
29 | #include <QtCharts/QBarSet> | |
|
30 | #include <QtCharts/QBarSeries> | |
|
31 | #include <QtCharts/QStackedBarSeries> | |
|
32 | #include <QtCharts/QPercentBarSeries> | |
|
33 | #include <QtWidgets/QPushButton> | |
|
34 | #include <QtWidgets/QComboBox> | |
|
35 | #include <QtWidgets/QSpinBox> | |
|
36 | #include <QtWidgets/QCheckBox> | |
|
37 | #include <QtWidgets/QGridLayout> | |
|
38 | #include <QtWidgets/QHBoxLayout> | |
|
39 | #include <QtWidgets/QLabel> | |
|
40 | #include <QtWidgets/QSpacerItem> | |
|
41 | #include <QtWidgets/QMessageBox> | |
|
42 | #include <cmath> | |
|
43 | #include <QtCore/QDebug> | |
|
44 | #include <QtGui/QStandardItemModel> | |
|
45 | #include <QtCharts/QBarCategoryAxis> | |
|
46 | #include <QtOpenGL/QGLWidget> | |
|
47 | ||
|
48 | QT_CHARTS_USE_NAMESPACE | |
|
49 | ||
|
50 | MainWidget::MainWidget(QWidget *parent) : | |
|
51 | QWidget(parent), | |
|
52 | m_addSerieDialog(0), | |
|
53 | m_chart(0) | |
|
54 | { | |
|
55 | m_chart = new QChart(); | |
|
56 | ||
|
57 | // Grid layout for the controls for configuring the chart widget | |
|
58 | QGridLayout *grid = new QGridLayout(); | |
|
59 | QPushButton *addSeriesButton = new QPushButton("Add series"); | |
|
60 | connect(addSeriesButton, SIGNAL(clicked()), this, SLOT(addSeries())); | |
|
61 | grid->addWidget(addSeriesButton, 0, 1); | |
|
62 | initBackroundCombo(grid); | |
|
63 | initScaleControls(grid); | |
|
64 | initThemeCombo(grid); | |
|
65 | initCheckboxes(grid); | |
|
66 | ||
|
67 | // add row with empty label to make all the other rows static | |
|
68 | grid->addWidget(new QLabel(""), grid->rowCount(), 0); | |
|
69 | grid->setRowStretch(grid->rowCount() - 1, 1); | |
|
70 | ||
|
71 | // Create chart view with the chart | |
|
72 | m_chartView = new QChartView(m_chart, this); | |
|
73 | m_chartView->setRubberBand(QChartView::HorizonalRubberBand); | |
|
74 | ||
|
75 | // Another grid layout as a main layout | |
|
76 | QGridLayout *mainLayout = new QGridLayout(); | |
|
77 | mainLayout->addLayout(grid, 0, 0); | |
|
78 | mainLayout->addWidget(m_chartView, 0, 1, 3, 1); | |
|
79 | setLayout(mainLayout); | |
|
80 | } | |
|
81 | ||
|
82 | // Combo box for selecting the chart's background | |
|
83 | void MainWidget::initBackroundCombo(QGridLayout *grid) | |
|
84 | { | |
|
85 | QComboBox *backgroundCombo = new QComboBox(this); | |
|
86 | backgroundCombo->addItem("Color"); | |
|
87 | backgroundCombo->addItem("Gradient"); | |
|
88 | backgroundCombo->addItem("Image"); | |
|
89 | connect(backgroundCombo, SIGNAL(currentIndexChanged(int)), | |
|
90 | this, SLOT(backgroundChanged(int))); | |
|
91 | ||
|
92 | grid->addWidget(new QLabel("Background:"), grid->rowCount(), 0); | |
|
93 | grid->addWidget(backgroundCombo, grid->rowCount() - 1, 1); | |
|
94 | } | |
|
95 | ||
|
96 | // Scale related controls (auto-scale vs. manual min-max values) | |
|
97 | void MainWidget::initScaleControls(QGridLayout *grid) | |
|
98 | { | |
|
99 | m_autoScaleCheck = new QCheckBox("Automatic scaling"); | |
|
100 | connect(m_autoScaleCheck, SIGNAL(stateChanged(int)), this, SLOT(autoScaleChanged(int))); | |
|
101 | // Allow setting also non-sense values (like -2147483648 and 2147483647) | |
|
102 | m_xMinSpin = new QSpinBox(); | |
|
103 | m_xMinSpin->setMinimum(INT_MIN); | |
|
104 | m_xMinSpin->setMaximum(INT_MAX); | |
|
105 | m_xMinSpin->setValue(0); | |
|
106 | connect(m_xMinSpin, SIGNAL(valueChanged(int)), this, SLOT(xMinChanged(int))); | |
|
107 | m_xMaxSpin = new QSpinBox(); | |
|
108 | m_xMaxSpin->setMinimum(INT_MIN); | |
|
109 | m_xMaxSpin->setMaximum(INT_MAX); | |
|
110 | m_xMaxSpin->setValue(10); | |
|
111 | connect(m_xMaxSpin, SIGNAL(valueChanged(int)), this, SLOT(xMaxChanged(int))); | |
|
112 | m_yMinSpin = new QSpinBox(); | |
|
113 | m_yMinSpin->setMinimum(INT_MIN); | |
|
114 | m_yMinSpin->setMaximum(INT_MAX); | |
|
115 | m_yMinSpin->setValue(0); | |
|
116 | connect(m_yMinSpin, SIGNAL(valueChanged(int)), this, SLOT(yMinChanged(int))); | |
|
117 | m_yMaxSpin = new QSpinBox(); | |
|
118 | m_yMaxSpin->setMinimum(INT_MIN); | |
|
119 | m_yMaxSpin->setMaximum(INT_MAX); | |
|
120 | m_yMaxSpin->setValue(10); | |
|
121 | connect(m_yMaxSpin, SIGNAL(valueChanged(int)), this, SLOT(yMaxChanged(int))); | |
|
122 | ||
|
123 | grid->addWidget(m_autoScaleCheck, grid->rowCount(), 0); | |
|
124 | grid->addWidget(new QLabel("x min:"), grid->rowCount(), 0); | |
|
125 | grid->addWidget(m_xMinSpin, grid->rowCount() - 1, 1); | |
|
126 | grid->addWidget(new QLabel("x max:"), grid->rowCount(), 0); | |
|
127 | grid->addWidget(m_xMaxSpin, grid->rowCount() - 1, 1); | |
|
128 | grid->addWidget(new QLabel("y min:"), grid->rowCount(), 0); | |
|
129 | grid->addWidget(m_yMinSpin, grid->rowCount() - 1, 1); | |
|
130 | grid->addWidget(new QLabel("y max:"), grid->rowCount(), 0); | |
|
131 | grid->addWidget(m_yMaxSpin, grid->rowCount() - 1, 1); | |
|
132 | ||
|
133 | m_autoScaleCheck->setChecked(true); | |
|
134 | } | |
|
135 | ||
|
136 | // Combo box for selecting theme | |
|
137 | void MainWidget::initThemeCombo(QGridLayout *grid) | |
|
138 | { | |
|
139 | QComboBox *chartTheme = new QComboBox(); | |
|
140 | chartTheme->addItem("Default"); | |
|
141 | chartTheme->addItem("Light"); | |
|
142 | chartTheme->addItem("Blue Cerulean"); | |
|
143 | chartTheme->addItem("Dark"); | |
|
144 | chartTheme->addItem("Brown Sand"); | |
|
145 | chartTheme->addItem("Blue NCS"); | |
|
146 | chartTheme->addItem("High Contrast"); | |
|
147 | chartTheme->addItem("Blue Icy"); | |
|
148 | chartTheme->addItem("Qt"); | |
|
149 | connect(chartTheme, SIGNAL(currentIndexChanged(int)), | |
|
150 | this, SLOT(changeChartTheme(int))); | |
|
151 | grid->addWidget(new QLabel("Chart theme:"), 8, 0); | |
|
152 | grid->addWidget(chartTheme, 8, 1); | |
|
153 | } | |
|
154 | ||
|
155 | // Different check boxes for customizing chart | |
|
156 | void MainWidget::initCheckboxes(QGridLayout *grid) | |
|
157 | { | |
|
158 | // TODO: setZoomEnabled slot has been removed from QChartView -> Re-implement zoom on/off | |
|
159 | QCheckBox *zoomCheckBox = new QCheckBox("Drag'n drop Zoom"); | |
|
160 | // connect(zoomCheckBox, SIGNAL(toggled(bool)), m_chartView, SLOT(setZoomEnabled(bool))); | |
|
161 | zoomCheckBox->setChecked(true); | |
|
162 | grid->addWidget(zoomCheckBox, grid->rowCount(), 0); | |
|
163 | ||
|
164 | QCheckBox *aliasCheckBox = new QCheckBox("Anti-alias"); | |
|
165 | connect(aliasCheckBox, SIGNAL(toggled(bool)), this, SLOT(antiAliasToggled(bool))); | |
|
166 | aliasCheckBox->setChecked(false); | |
|
167 | grid->addWidget(aliasCheckBox, grid->rowCount(), 0); | |
|
168 | ||
|
169 | QCheckBox *openGLCheckBox = new QCheckBox("Use QGLWidget"); | |
|
170 | connect(openGLCheckBox, SIGNAL(toggled(bool)), this, SLOT(openGLToggled(bool))); | |
|
171 | openGLCheckBox->setChecked(false); | |
|
172 | grid->addWidget(openGLCheckBox, grid->rowCount(), 0); | |
|
173 | } | |
|
174 | ||
|
175 | void MainWidget::antiAliasToggled(bool enabled) | |
|
176 | { | |
|
177 | m_chartView->setRenderHint(QPainter::Antialiasing, enabled); | |
|
178 | } | |
|
179 | ||
|
180 | void MainWidget::openGLToggled(bool enabled) | |
|
181 | { | |
|
182 | if (enabled) { | |
|
183 | QGLFormat f = QGLFormat::defaultFormat(); | |
|
184 | f.setSampleBuffers(true); | |
|
185 | f.setSamples(4); | |
|
186 | QGLFormat::setDefaultFormat(f); | |
|
187 | QGLWidget *g = new QGLWidget(); | |
|
188 | m_chartView->setViewport(g); | |
|
189 | } else { | |
|
190 | m_chartView->setViewport(0); | |
|
191 | } | |
|
192 | } | |
|
193 | ||
|
194 | void MainWidget::addSeries() | |
|
195 | { | |
|
196 | if (!m_addSerieDialog) { | |
|
197 | m_addSerieDialog = new DataSerieDialog(this); | |
|
198 | connect(m_addSerieDialog, SIGNAL(accepted(QString,int,int,QString,bool)), | |
|
199 | this, SLOT(addSeries(QString,int,int,QString,bool))); | |
|
200 | } | |
|
201 | m_addSerieDialog->exec(); | |
|
202 | } | |
|
203 | ||
|
204 | QList<RealList> MainWidget::generateTestData(int columnCount, int rowCount, QString dataCharacteristics) | |
|
205 | { | |
|
206 | QList<RealList> testData; | |
|
207 | for (int j(0); j < columnCount; j++) { | |
|
208 | QList <qreal> newColumn; | |
|
209 | for (int i(0); i < rowCount; i++) { | |
|
210 | if (dataCharacteristics == "Sin") { | |
|
211 | newColumn.append(abs(sin(3.14159265358979 / 50 * i) * 100)); | |
|
212 | } else if (dataCharacteristics == "Sin + random") { | |
|
213 | newColumn.append(abs(sin(3.14159265358979 / 50 * i) * 100) + (rand() % 5)); | |
|
214 | } else if (dataCharacteristics == "Random") { | |
|
215 | newColumn.append(rand() % 10 + (qreal) rand() / (qreal) RAND_MAX); | |
|
216 | } else if (dataCharacteristics == "Linear") { | |
|
217 | //newColumn.append(i * (j + 1.0)); | |
|
218 | // TODO: temporary hack to make pie work; prevent zero values: | |
|
219 | newColumn.append(i * (j + 1.0) + 0.1); | |
|
220 | } else { // "constant" | |
|
221 | newColumn.append((j + 1.0)); | |
|
222 | } | |
|
223 | } | |
|
224 | testData.append(newColumn); | |
|
225 | } | |
|
226 | return testData; | |
|
227 | } | |
|
228 | ||
|
229 | QStringList MainWidget::generateLabels(int count) | |
|
230 | { | |
|
231 | QStringList result; | |
|
232 | for (int i(0); i < count; i++) | |
|
233 | result.append("label" + QString::number(i)); | |
|
234 | return result; | |
|
235 | } | |
|
236 | ||
|
237 | void MainWidget::addSeries(QString seriesName, int columnCount, int rowCount, QString dataCharacteristics, bool labelsEnabled) | |
|
238 | { | |
|
239 | qDebug() << "addSeries: " << seriesName | |
|
240 | << " columnCount: " << columnCount | |
|
241 | << " rowCount: " << rowCount | |
|
242 | << " dataCharacteristics: " << dataCharacteristics | |
|
243 | << " labels enabled: " << labelsEnabled; | |
|
244 | m_defaultSeriesName = seriesName; | |
|
245 | ||
|
246 | QList<RealList> data = generateTestData(columnCount, rowCount, dataCharacteristics); | |
|
247 | ||
|
248 | // Line series and scatter series use similar data | |
|
249 | if (seriesName == "Line") { | |
|
250 | for (int j(0); j < data.count(); j ++) { | |
|
251 | QList<qreal> column = data.at(j); | |
|
252 | QLineSeries *series = new QLineSeries(); | |
|
253 | series->setName("line" + QString::number(j)); | |
|
254 | for (int i(0); i < column.count(); i++) | |
|
255 | series->append(i, column.at(i)); | |
|
256 | m_chart->addSeries(series); | |
|
257 | } | |
|
258 | } else if (seriesName == "Area") { | |
|
259 | // TODO: lower series for the area? | |
|
260 | for (int j(0); j < data.count(); j ++) { | |
|
261 | QList<qreal> column = data.at(j); | |
|
262 | QLineSeries *lineSeries = new QLineSeries(); | |
|
263 | for (int i(0); i < column.count(); i++) | |
|
264 | lineSeries->append(i, column.at(i)); | |
|
265 | QAreaSeries *areaSeries = new QAreaSeries(lineSeries); | |
|
266 | areaSeries->setName("area" + QString::number(j)); | |
|
267 | m_chart->addSeries(areaSeries); | |
|
268 | } | |
|
269 | } else if (seriesName == "Scatter") { | |
|
270 | for (int j(0); j < data.count(); j++) { | |
|
271 | QList<qreal> column = data.at(j); | |
|
272 | QScatterSeries *series = new QScatterSeries(); | |
|
273 | series->setName("scatter" + QString::number(j)); | |
|
274 | for (int i(0); i < column.count(); i++) | |
|
275 | series->append(i, column.at(i)); | |
|
276 | m_chart->addSeries(series); | |
|
277 | } | |
|
278 | } else if (seriesName == "Pie") { | |
|
279 | QStringList labels = generateLabels(rowCount); | |
|
280 | for (int j(0); j < data.count(); j++) { | |
|
281 | QPieSeries *series = new QPieSeries(); | |
|
282 | QList<qreal> column = data.at(j); | |
|
283 | for (int i(0); i < column.count(); i++) | |
|
284 | series->append(labels.at(i), column.at(i)); | |
|
285 | m_chart->addSeries(series); | |
|
286 | } | |
|
287 | } else if (seriesName == "Bar" | |
|
288 | || seriesName == "Stacked bar" | |
|
289 | || seriesName == "Percent bar") { | |
|
290 | QStringList category; | |
|
291 | QStringList labels = generateLabels(rowCount); | |
|
292 | foreach (QString label, labels) | |
|
293 | category << label; | |
|
294 | QAbstractBarSeries* series = 0; | |
|
295 | if (seriesName == "Bar") { | |
|
296 | series = new QBarSeries(this); | |
|
297 | QBarCategoryAxis* axis = new QBarCategoryAxis(); | |
|
298 | axis->append(category); | |
|
299 | m_chart->setAxisX(axis,series); | |
|
300 | } else if (seriesName == "Stacked bar") { | |
|
301 | series = new QStackedBarSeries(this); | |
|
302 | QBarCategoryAxis* axis = new QBarCategoryAxis(); | |
|
303 | axis->append(category); | |
|
304 | m_chart->setAxisX(axis,series); | |
|
305 | } else { | |
|
306 | series = new QPercentBarSeries(this); | |
|
307 | QBarCategoryAxis* axis = new QBarCategoryAxis(); | |
|
308 | axis->append(category); | |
|
309 | m_chart->setAxisX(axis,series); | |
|
310 | } | |
|
311 | ||
|
312 | for (int j(0); j < data.count(); j++) { | |
|
313 | QList<qreal> column = data.at(j); | |
|
314 | QBarSet *set = new QBarSet("set" + QString::number(j)); | |
|
315 | for (int i(0); i < column.count(); i++) | |
|
316 | *set << column.at(i); | |
|
317 | series->append(set); | |
|
318 | } | |
|
319 | ||
|
320 | m_chart->addSeries(series); | |
|
321 | } else if (seriesName == "Spline") { | |
|
322 | for (int j(0); j < data.count(); j ++) { | |
|
323 | QList<qreal> column = data.at(j); | |
|
324 | QSplineSeries *series = new QSplineSeries(); | |
|
325 | series->setName("spline" + QString::number(j)); | |
|
326 | for (int i(0); i < column.count(); i++) | |
|
327 | series->append(i, column.at(i)); | |
|
328 | m_chart->addSeries(series); | |
|
329 | } | |
|
330 | } | |
|
331 | m_chart->createDefaultAxes(); | |
|
332 | } | |
|
333 | ||
|
334 | void MainWidget::backgroundChanged(int itemIndex) | |
|
335 | { | |
|
336 | qDebug() << "backgroundChanged: " << itemIndex; | |
|
337 | } | |
|
338 | ||
|
339 | void MainWidget::autoScaleChanged(int value) | |
|
340 | { | |
|
341 | if (value) { | |
|
342 | // TODO: enable auto scaling | |
|
343 | } else { | |
|
344 | // TODO: set scaling manually (and disable auto scaling) | |
|
345 | } | |
|
346 | ||
|
347 | m_xMinSpin->setEnabled(!value); | |
|
348 | m_xMaxSpin->setEnabled(!value); | |
|
349 | m_yMinSpin->setEnabled(!value); | |
|
350 | m_yMaxSpin->setEnabled(!value); | |
|
351 | } | |
|
352 | ||
|
353 | void MainWidget::xMinChanged(int value) | |
|
354 | { | |
|
355 | qDebug() << "xMinChanged: " << value; | |
|
356 | } | |
|
357 | ||
|
358 | void MainWidget::xMaxChanged(int value) | |
|
359 | { | |
|
360 | qDebug() << "xMaxChanged: " << value; | |
|
361 | } | |
|
362 | ||
|
363 | void MainWidget::yMinChanged(int value) | |
|
364 | { | |
|
365 | qDebug() << "yMinChanged: " << value; | |
|
366 | } | |
|
367 | ||
|
368 | void MainWidget::yMaxChanged(int value) | |
|
369 | { | |
|
370 | qDebug() << "yMaxChanged: " << value; | |
|
371 | } | |
|
372 | ||
|
373 | void MainWidget::changeChartTheme(int themeIndex) | |
|
374 | { | |
|
375 | qDebug() << "changeChartTheme: " << themeIndex; | |
|
376 | if (themeIndex == 0) | |
|
377 | m_chart->setTheme(QChart::ChartThemeLight); | |
|
378 | else | |
|
379 | m_chart->setTheme((QChart::ChartTheme) (themeIndex - 1)); | |
|
380 | } | |
|
1 | /**************************************************************************** | |
|
2 | ** | |
|
3 | ** Copyright (C) 2014 Digia Plc | |
|
4 | ** All rights reserved. | |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
|
6 | ** | |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
|
8 | ** | |
|
9 | ** $QT_BEGIN_LICENSE$ | |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
|
13 | ** a written agreement between you and Digia. | |
|
14 | ** | |
|
15 | ** If you have questions regarding the use of this file, please use | |
|
16 | ** contact form at http://qt.digia.com | |
|
17 | ** $QT_END_LICENSE$ | |
|
18 | ** | |
|
19 | ****************************************************************************/ | |
|
20 | ||
|
21 | #include "mainwidget.h" | |
|
22 | #include "dataseriedialog.h" | |
|
23 | #include <QtCharts/QChartView> | |
|
24 | #include <QtCharts/QPieSeries> | |
|
25 | #include <QtCharts/QScatterSeries> | |
|
26 | #include <QtCharts/QLineSeries> | |
|
27 | #include <QtCharts/QAreaSeries> | |
|
28 | #include <QtCharts/QSplineSeries> | |
|
29 | #include <QtCharts/QBarSet> | |
|
30 | #include <QtCharts/QBarSeries> | |
|
31 | #include <QtCharts/QStackedBarSeries> | |
|
32 | #include <QtCharts/QPercentBarSeries> | |
|
33 | #include <QtWidgets/QPushButton> | |
|
34 | #include <QtWidgets/QComboBox> | |
|
35 | #include <QtWidgets/QSpinBox> | |
|
36 | #include <QtWidgets/QCheckBox> | |
|
37 | #include <QtWidgets/QGridLayout> | |
|
38 | #include <QtWidgets/QHBoxLayout> | |
|
39 | #include <QtWidgets/QLabel> | |
|
40 | #include <QtWidgets/QSpacerItem> | |
|
41 | #include <QtWidgets/QMessageBox> | |
|
42 | #include <cmath> | |
|
43 | #include <QtCore/QDebug> | |
|
44 | #include <QtGui/QStandardItemModel> | |
|
45 | #include <QtCharts/QBarCategoryAxis> | |
|
46 | #include <QtOpenGL/QGLWidget> | |
|
47 | ||
|
48 | QT_CHARTS_USE_NAMESPACE | |
|
49 | ||
|
50 | MainWidget::MainWidget(QWidget *parent) : | |
|
51 | QWidget(parent), | |
|
52 | m_addSerieDialog(0), | |
|
53 | m_chart(0) | |
|
54 | { | |
|
55 | m_chart = new QChart(); | |
|
56 | ||
|
57 | // Grid layout for the controls for configuring the chart widget | |
|
58 | QGridLayout *grid = new QGridLayout(); | |
|
59 | QPushButton *addSeriesButton = new QPushButton("Add series"); | |
|
60 | connect(addSeriesButton, SIGNAL(clicked()), this, SLOT(addSeries())); | |
|
61 | grid->addWidget(addSeriesButton, 0, 1); | |
|
62 | initBackroundCombo(grid); | |
|
63 | initScaleControls(grid); | |
|
64 | initThemeCombo(grid); | |
|
65 | initCheckboxes(grid); | |
|
66 | ||
|
67 | // add row with empty label to make all the other rows static | |
|
68 | grid->addWidget(new QLabel(""), grid->rowCount(), 0); | |
|
69 | grid->setRowStretch(grid->rowCount() - 1, 1); | |
|
70 | ||
|
71 | // Create chart view with the chart | |
|
72 | m_chartView = new QChartView(m_chart, this); | |
|
73 | m_chartView->setRubberBand(QChartView::HorizonalRubberBand); | |
|
74 | ||
|
75 | // Another grid layout as a main layout | |
|
76 | QGridLayout *mainLayout = new QGridLayout(); | |
|
77 | mainLayout->addLayout(grid, 0, 0); | |
|
78 | mainLayout->addWidget(m_chartView, 0, 1, 3, 1); | |
|
79 | setLayout(mainLayout); | |
|
80 | } | |
|
81 | ||
|
82 | // Combo box for selecting the chart's background | |
|
83 | void MainWidget::initBackroundCombo(QGridLayout *grid) | |
|
84 | { | |
|
85 | QComboBox *backgroundCombo = new QComboBox(this); | |
|
86 | backgroundCombo->addItem("Color"); | |
|
87 | backgroundCombo->addItem("Gradient"); | |
|
88 | backgroundCombo->addItem("Image"); | |
|
89 | connect(backgroundCombo, SIGNAL(currentIndexChanged(int)), | |
|
90 | this, SLOT(backgroundChanged(int))); | |
|
91 | ||
|
92 | grid->addWidget(new QLabel("Background:"), grid->rowCount(), 0); | |
|
93 | grid->addWidget(backgroundCombo, grid->rowCount() - 1, 1); | |
|
94 | } | |
|
95 | ||
|
96 | // Scale related controls (auto-scale vs. manual min-max values) | |
|
97 | void MainWidget::initScaleControls(QGridLayout *grid) | |
|
98 | { | |
|
99 | m_autoScaleCheck = new QCheckBox("Automatic scaling"); | |
|
100 | connect(m_autoScaleCheck, SIGNAL(stateChanged(int)), this, SLOT(autoScaleChanged(int))); | |
|
101 | // Allow setting also non-sense values (like -2147483648 and 2147483647) | |
|
102 | m_xMinSpin = new QSpinBox(); | |
|
103 | m_xMinSpin->setMinimum(INT_MIN); | |
|
104 | m_xMinSpin->setMaximum(INT_MAX); | |
|
105 | m_xMinSpin->setValue(0); | |
|
106 | connect(m_xMinSpin, SIGNAL(valueChanged(int)), this, SLOT(xMinChanged(int))); | |
|
107 | m_xMaxSpin = new QSpinBox(); | |
|
108 | m_xMaxSpin->setMinimum(INT_MIN); | |
|
109 | m_xMaxSpin->setMaximum(INT_MAX); | |
|
110 | m_xMaxSpin->setValue(10); | |
|
111 | connect(m_xMaxSpin, SIGNAL(valueChanged(int)), this, SLOT(xMaxChanged(int))); | |
|
112 | m_yMinSpin = new QSpinBox(); | |
|
113 | m_yMinSpin->setMinimum(INT_MIN); | |
|
114 | m_yMinSpin->setMaximum(INT_MAX); | |
|
115 | m_yMinSpin->setValue(0); | |
|
116 | connect(m_yMinSpin, SIGNAL(valueChanged(int)), this, SLOT(yMinChanged(int))); | |
|
117 | m_yMaxSpin = new QSpinBox(); | |
|
118 | m_yMaxSpin->setMinimum(INT_MIN); | |
|
119 | m_yMaxSpin->setMaximum(INT_MAX); | |
|
120 | m_yMaxSpin->setValue(10); | |
|
121 | connect(m_yMaxSpin, SIGNAL(valueChanged(int)), this, SLOT(yMaxChanged(int))); | |
|
122 | ||
|
123 | grid->addWidget(m_autoScaleCheck, grid->rowCount(), 0); | |
|
124 | grid->addWidget(new QLabel("x min:"), grid->rowCount(), 0); | |
|
125 | grid->addWidget(m_xMinSpin, grid->rowCount() - 1, 1); | |
|
126 | grid->addWidget(new QLabel("x max:"), grid->rowCount(), 0); | |
|
127 | grid->addWidget(m_xMaxSpin, grid->rowCount() - 1, 1); | |
|
128 | grid->addWidget(new QLabel("y min:"), grid->rowCount(), 0); | |
|
129 | grid->addWidget(m_yMinSpin, grid->rowCount() - 1, 1); | |
|
130 | grid->addWidget(new QLabel("y max:"), grid->rowCount(), 0); | |
|
131 | grid->addWidget(m_yMaxSpin, grid->rowCount() - 1, 1); | |
|
132 | ||
|
133 | m_autoScaleCheck->setChecked(true); | |
|
134 | } | |
|
135 | ||
|
136 | // Combo box for selecting theme | |
|
137 | void MainWidget::initThemeCombo(QGridLayout *grid) | |
|
138 | { | |
|
139 | QComboBox *chartTheme = new QComboBox(); | |
|
140 | chartTheme->addItem("Default"); | |
|
141 | chartTheme->addItem("Light"); | |
|
142 | chartTheme->addItem("Blue Cerulean"); | |
|
143 | chartTheme->addItem("Dark"); | |
|
144 | chartTheme->addItem("Brown Sand"); | |
|
145 | chartTheme->addItem("Blue NCS"); | |
|
146 | chartTheme->addItem("High Contrast"); | |
|
147 | chartTheme->addItem("Blue Icy"); | |
|
148 | chartTheme->addItem("Qt"); | |
|
149 | connect(chartTheme, SIGNAL(currentIndexChanged(int)), | |
|
150 | this, SLOT(changeChartTheme(int))); | |
|
151 | grid->addWidget(new QLabel("Chart theme:"), 8, 0); | |
|
152 | grid->addWidget(chartTheme, 8, 1); | |
|
153 | } | |
|
154 | ||
|
155 | // Different check boxes for customizing chart | |
|
156 | void MainWidget::initCheckboxes(QGridLayout *grid) | |
|
157 | { | |
|
158 | // TODO: setZoomEnabled slot has been removed from QChartView -> Re-implement zoom on/off | |
|
159 | QCheckBox *zoomCheckBox = new QCheckBox("Drag'n drop Zoom"); | |
|
160 | // connect(zoomCheckBox, SIGNAL(toggled(bool)), m_chartView, SLOT(setZoomEnabled(bool))); | |
|
161 | zoomCheckBox->setChecked(true); | |
|
162 | grid->addWidget(zoomCheckBox, grid->rowCount(), 0); | |
|
163 | ||
|
164 | QCheckBox *aliasCheckBox = new QCheckBox("Anti-alias"); | |
|
165 | connect(aliasCheckBox, SIGNAL(toggled(bool)), this, SLOT(antiAliasToggled(bool))); | |
|
166 | aliasCheckBox->setChecked(false); | |
|
167 | grid->addWidget(aliasCheckBox, grid->rowCount(), 0); | |
|
168 | ||
|
169 | QCheckBox *openGLCheckBox = new QCheckBox("Use QGLWidget"); | |
|
170 | connect(openGLCheckBox, SIGNAL(toggled(bool)), this, SLOT(openGLToggled(bool))); | |
|
171 | openGLCheckBox->setChecked(false); | |
|
172 | grid->addWidget(openGLCheckBox, grid->rowCount(), 0); | |
|
173 | } | |
|
174 | ||
|
175 | void MainWidget::antiAliasToggled(bool enabled) | |
|
176 | { | |
|
177 | m_chartView->setRenderHint(QPainter::Antialiasing, enabled); | |
|
178 | } | |
|
179 | ||
|
180 | void MainWidget::openGLToggled(bool enabled) | |
|
181 | { | |
|
182 | if (enabled) { | |
|
183 | QGLFormat f = QGLFormat::defaultFormat(); | |
|
184 | f.setSampleBuffers(true); | |
|
185 | f.setSamples(4); | |
|
186 | QGLFormat::setDefaultFormat(f); | |
|
187 | QGLWidget *g = new QGLWidget(); | |
|
188 | m_chartView->setViewport(g); | |
|
189 | } else { | |
|
190 | m_chartView->setViewport(0); | |
|
191 | } | |
|
192 | } | |
|
193 | ||
|
194 | void MainWidget::addSeries() | |
|
195 | { | |
|
196 | if (!m_addSerieDialog) { | |
|
197 | m_addSerieDialog = new DataSerieDialog(this); | |
|
198 | connect(m_addSerieDialog, SIGNAL(accepted(QString,int,int,QString,bool)), | |
|
199 | this, SLOT(addSeries(QString,int,int,QString,bool))); | |
|
200 | } | |
|
201 | m_addSerieDialog->exec(); | |
|
202 | } | |
|
203 | ||
|
204 | QList<RealList> MainWidget::generateTestData(int columnCount, int rowCount, QString dataCharacteristics) | |
|
205 | { | |
|
206 | QList<RealList> testData; | |
|
207 | for (int j(0); j < columnCount; j++) { | |
|
208 | QList <qreal> newColumn; | |
|
209 | for (int i(0); i < rowCount; i++) { | |
|
210 | if (dataCharacteristics == "Sin") { | |
|
211 | newColumn.append(abs(sin(3.14159265358979 / 50 * i) * 100)); | |
|
212 | } else if (dataCharacteristics == "Sin + random") { | |
|
213 | newColumn.append(abs(sin(3.14159265358979 / 50 * i) * 100) + (rand() % 5)); | |
|
214 | } else if (dataCharacteristics == "Random") { | |
|
215 | newColumn.append(rand() % 10 + (qreal) rand() / (qreal) RAND_MAX); | |
|
216 | } else if (dataCharacteristics == "Linear") { | |
|
217 | //newColumn.append(i * (j + 1.0)); | |
|
218 | // TODO: temporary hack to make pie work; prevent zero values: | |
|
219 | newColumn.append(i * (j + 1.0) + 0.1); | |
|
220 | } else { // "constant" | |
|
221 | newColumn.append((j + 1.0)); | |
|
222 | } | |
|
223 | } | |
|
224 | testData.append(newColumn); | |
|
225 | } | |
|
226 | return testData; | |
|
227 | } | |
|
228 | ||
|
229 | QStringList MainWidget::generateLabels(int count) | |
|
230 | { | |
|
231 | QStringList result; | |
|
232 | for (int i(0); i < count; i++) | |
|
233 | result.append("label" + QString::number(i)); | |
|
234 | return result; | |
|
235 | } | |
|
236 | ||
|
237 | void MainWidget::addSeries(QString seriesName, int columnCount, int rowCount, QString dataCharacteristics, bool labelsEnabled) | |
|
238 | { | |
|
239 | qDebug() << "addSeries: " << seriesName | |
|
240 | << " columnCount: " << columnCount | |
|
241 | << " rowCount: " << rowCount | |
|
242 | << " dataCharacteristics: " << dataCharacteristics | |
|
243 | << " labels enabled: " << labelsEnabled; | |
|
244 | m_defaultSeriesName = seriesName; | |
|
245 | ||
|
246 | QList<RealList> data = generateTestData(columnCount, rowCount, dataCharacteristics); | |
|
247 | ||
|
248 | // Line series and scatter series use similar data | |
|
249 | if (seriesName == "Line") { | |
|
250 | for (int j(0); j < data.count(); j ++) { | |
|
251 | QList<qreal> column = data.at(j); | |
|
252 | QLineSeries *series = new QLineSeries(); | |
|
253 | series->setName("line" + QString::number(j)); | |
|
254 | for (int i(0); i < column.count(); i++) | |
|
255 | series->append(i, column.at(i)); | |
|
256 | m_chart->addSeries(series); | |
|
257 | } | |
|
258 | } else if (seriesName == "Area") { | |
|
259 | // TODO: lower series for the area? | |
|
260 | for (int j(0); j < data.count(); j ++) { | |
|
261 | QList<qreal> column = data.at(j); | |
|
262 | QLineSeries *lineSeries = new QLineSeries(); | |
|
263 | for (int i(0); i < column.count(); i++) | |
|
264 | lineSeries->append(i, column.at(i)); | |
|
265 | QAreaSeries *areaSeries = new QAreaSeries(lineSeries); | |
|
266 | areaSeries->setName("area" + QString::number(j)); | |
|
267 | m_chart->addSeries(areaSeries); | |
|
268 | } | |
|
269 | } else if (seriesName == "Scatter") { | |
|
270 | for (int j(0); j < data.count(); j++) { | |
|
271 | QList<qreal> column = data.at(j); | |
|
272 | QScatterSeries *series = new QScatterSeries(); | |
|
273 | series->setName("scatter" + QString::number(j)); | |
|
274 | for (int i(0); i < column.count(); i++) | |
|
275 | series->append(i, column.at(i)); | |
|
276 | m_chart->addSeries(series); | |
|
277 | } | |
|
278 | } else if (seriesName == "Pie") { | |
|
279 | QStringList labels = generateLabels(rowCount); | |
|
280 | for (int j(0); j < data.count(); j++) { | |
|
281 | QPieSeries *series = new QPieSeries(); | |
|
282 | QList<qreal> column = data.at(j); | |
|
283 | for (int i(0); i < column.count(); i++) | |
|
284 | series->append(labels.at(i), column.at(i)); | |
|
285 | m_chart->addSeries(series); | |
|
286 | } | |
|
287 | } else if (seriesName == "Bar" | |
|
288 | || seriesName == "Stacked bar" | |
|
289 | || seriesName == "Percent bar") { | |
|
290 | QStringList category; | |
|
291 | QStringList labels = generateLabels(rowCount); | |
|
292 | foreach (QString label, labels) | |
|
293 | category << label; | |
|
294 | QAbstractBarSeries* series = 0; | |
|
295 | if (seriesName == "Bar") { | |
|
296 | series = new QBarSeries(this); | |
|
297 | QBarCategoryAxis* axis = new QBarCategoryAxis(); | |
|
298 | axis->append(category); | |
|
299 | m_chart->setAxisX(axis,series); | |
|
300 | } else if (seriesName == "Stacked bar") { | |
|
301 | series = new QStackedBarSeries(this); | |
|
302 | QBarCategoryAxis* axis = new QBarCategoryAxis(); | |
|
303 | axis->append(category); | |
|
304 | m_chart->setAxisX(axis,series); | |
|
305 | } else { | |
|
306 | series = new QPercentBarSeries(this); | |
|
307 | QBarCategoryAxis* axis = new QBarCategoryAxis(); | |
|
308 | axis->append(category); | |
|
309 | m_chart->setAxisX(axis,series); | |
|
310 | } | |
|
311 | ||
|
312 | for (int j(0); j < data.count(); j++) { | |
|
313 | QList<qreal> column = data.at(j); | |
|
314 | QBarSet *set = new QBarSet("set" + QString::number(j)); | |
|
315 | for (int i(0); i < column.count(); i++) | |
|
316 | *set << column.at(i); | |
|
317 | series->append(set); | |
|
318 | } | |
|
319 | ||
|
320 | m_chart->addSeries(series); | |
|
321 | } else if (seriesName == "Spline") { | |
|
322 | for (int j(0); j < data.count(); j ++) { | |
|
323 | QList<qreal> column = data.at(j); | |
|
324 | QSplineSeries *series = new QSplineSeries(); | |
|
325 | series->setName("spline" + QString::number(j)); | |
|
326 | for (int i(0); i < column.count(); i++) | |
|
327 | series->append(i, column.at(i)); | |
|
328 | m_chart->addSeries(series); | |
|
329 | } | |
|
330 | } | |
|
331 | m_chart->createDefaultAxes(); | |
|
332 | } | |
|
333 | ||
|
334 | void MainWidget::backgroundChanged(int itemIndex) | |
|
335 | { | |
|
336 | qDebug() << "backgroundChanged: " << itemIndex; | |
|
337 | } | |
|
338 | ||
|
339 | void MainWidget::autoScaleChanged(int value) | |
|
340 | { | |
|
341 | if (value) { | |
|
342 | // TODO: enable auto scaling | |
|
343 | } else { | |
|
344 | // TODO: set scaling manually (and disable auto scaling) | |
|
345 | } | |
|
346 | ||
|
347 | m_xMinSpin->setEnabled(!value); | |
|
348 | m_xMaxSpin->setEnabled(!value); | |
|
349 | m_yMinSpin->setEnabled(!value); | |
|
350 | m_yMaxSpin->setEnabled(!value); | |
|
351 | } | |
|
352 | ||
|
353 | void MainWidget::xMinChanged(int value) | |
|
354 | { | |
|
355 | qDebug() << "xMinChanged: " << value; | |
|
356 | } | |
|
357 | ||
|
358 | void MainWidget::xMaxChanged(int value) | |
|
359 | { | |
|
360 | qDebug() << "xMaxChanged: " << value; | |
|
361 | } | |
|
362 | ||
|
363 | void MainWidget::yMinChanged(int value) | |
|
364 | { | |
|
365 | qDebug() << "yMinChanged: " << value; | |
|
366 | } | |
|
367 | ||
|
368 | void MainWidget::yMaxChanged(int value) | |
|
369 | { | |
|
370 | qDebug() << "yMaxChanged: " << value; | |
|
371 | } | |
|
372 | ||
|
373 | void MainWidget::changeChartTheme(int themeIndex) | |
|
374 | { | |
|
375 | qDebug() << "changeChartTheme: " << themeIndex; | |
|
376 | if (themeIndex == 0) | |
|
377 | m_chart->setTheme(QChart::ChartThemeLight); | |
|
378 | else | |
|
379 | m_chart->setTheme((QChart::ChartTheme) (themeIndex - 1)); | |
|
380 | } |
@@ -1,80 +1,80 | |||
|
1 | /**************************************************************************** | |
|
2 | ** | |
|
3 | ** Copyright (C) 2014 Digia Plc | |
|
4 | ** All rights reserved. | |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
|
6 | ** | |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
|
8 | ** | |
|
9 | ** $QT_BEGIN_LICENSE$ | |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
|
13 | ** a written agreement between you and Digia. | |
|
14 | ** | |
|
15 | ** If you have questions regarding the use of this file, please use | |
|
16 | ** contact form at http://qt.digia.com | |
|
17 | ** $QT_END_LICENSE$ | |
|
18 | ** | |
|
19 | ****************************************************************************/ | |
|
20 | ||
|
21 | #ifndef MAINWIDGET_H | |
|
22 | #define MAINWIDGET_H | |
|
23 | ||
|
24 | #include <QtCharts/QChartGlobal> | |
|
25 | #include <QtCharts/QChart> | |
|
26 | #include <QtCharts/QChartView> | |
|
27 | #include <QtWidgets/QWidget> | |
|
28 | ||
|
29 | class QSpinBox; | |
|
30 | class QCheckBox; | |
|
31 | class QGridLayout; | |
|
32 | ||
|
33 | QT_CHARTS_USE_NAMESPACE | |
|
34 | ||
|
35 | #define RealList QList<qreal> | |
|
36 | class DataSerieDialog; | |
|
37 | ||
|
38 | class MainWidget : public QWidget | |
|
39 | { | |
|
40 | Q_OBJECT | |
|
41 | public: | |
|
42 | explicit MainWidget(QWidget *parent = 0); | |
|
43 | ||
|
44 | signals: | |
|
45 | ||
|
46 | private: | |
|
47 | void initBackroundCombo(QGridLayout *grid); | |
|
48 | void initScaleControls(QGridLayout *grid); | |
|
49 | void initThemeCombo(QGridLayout *grid); | |
|
50 | void initCheckboxes(QGridLayout *grid); | |
|
51 | ||
|
52 | private slots: | |
|
53 | void addSeries(); | |
|
54 | void addSeries(QString series, int columnCount, int rowCount, QString dataCharacteristics, bool labelsEnabled); | |
|
55 | void backgroundChanged(int itemIndex); | |
|
56 | void autoScaleChanged(int value); | |
|
57 | void xMinChanged(int value); | |
|
58 | void xMaxChanged(int value); | |
|
59 | void yMinChanged(int value); | |
|
60 | void yMaxChanged(int value); | |
|
61 | void antiAliasToggled(bool enabled); | |
|
62 | void openGLToggled(bool enabled); | |
|
63 | void changeChartTheme(int themeIndex); | |
|
64 | QList<RealList> generateTestData(int columnCount, int rowCount, QString dataCharacteristics); | |
|
65 | QStringList generateLabels(int count); | |
|
66 | ||
|
67 | private: | |
|
68 | DataSerieDialog *m_addSerieDialog; | |
|
69 | QChart *m_chart; | |
|
70 | QChartView *m_chartView; | |
|
71 | QCheckBox *m_autoScaleCheck; | |
|
72 | QSpinBox *m_xMinSpin; | |
|
73 | QSpinBox *m_xMaxSpin; | |
|
74 | QSpinBox *m_yMinSpin; | |
|
75 | QSpinBox *m_yMaxSpin; | |
|
76 | QString m_defaultSeriesName; | |
|
77 | QGridLayout *m_scatterLayout; | |
|
78 | }; | |
|
79 | ||
|
80 | #endif // MAINWIDGET_H | |
|
1 | /**************************************************************************** | |
|
2 | ** | |
|
3 | ** Copyright (C) 2014 Digia Plc | |
|
4 | ** All rights reserved. | |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
|
6 | ** | |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
|
8 | ** | |
|
9 | ** $QT_BEGIN_LICENSE$ | |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
|
13 | ** a written agreement between you and Digia. | |
|
14 | ** | |
|
15 | ** If you have questions regarding the use of this file, please use | |
|
16 | ** contact form at http://qt.digia.com | |
|
17 | ** $QT_END_LICENSE$ | |
|
18 | ** | |
|
19 | ****************************************************************************/ | |
|
20 | ||
|
21 | #ifndef MAINWIDGET_H | |
|
22 | #define MAINWIDGET_H | |
|
23 | ||
|
24 | #include <QtCharts/QChartGlobal> | |
|
25 | #include <QtCharts/QChart> | |
|
26 | #include <QtCharts/QChartView> | |
|
27 | #include <QtWidgets/QWidget> | |
|
28 | ||
|
29 | class QSpinBox; | |
|
30 | class QCheckBox; | |
|
31 | class QGridLayout; | |
|
32 | ||
|
33 | QT_CHARTS_USE_NAMESPACE | |
|
34 | ||
|
35 | #define RealList QList<qreal> | |
|
36 | class DataSerieDialog; | |
|
37 | ||
|
38 | class MainWidget : public QWidget | |
|
39 | { | |
|
40 | Q_OBJECT | |
|
41 | public: | |
|
42 | explicit MainWidget(QWidget *parent = 0); | |
|
43 | ||
|
44 | signals: | |
|
45 | ||
|
46 | private: | |
|
47 | void initBackroundCombo(QGridLayout *grid); | |
|
48 | void initScaleControls(QGridLayout *grid); | |
|
49 | void initThemeCombo(QGridLayout *grid); | |
|
50 | void initCheckboxes(QGridLayout *grid); | |
|
51 | ||
|
52 | private slots: | |
|
53 | void addSeries(); | |
|
54 | void addSeries(QString series, int columnCount, int rowCount, QString dataCharacteristics, bool labelsEnabled); | |
|
55 | void backgroundChanged(int itemIndex); | |
|
56 | void autoScaleChanged(int value); | |
|
57 | void xMinChanged(int value); | |
|
58 | void xMaxChanged(int value); | |
|
59 | void yMinChanged(int value); | |
|
60 | void yMaxChanged(int value); | |
|
61 | void antiAliasToggled(bool enabled); | |
|
62 | void openGLToggled(bool enabled); | |
|
63 | void changeChartTheme(int themeIndex); | |
|
64 | QList<RealList> generateTestData(int columnCount, int rowCount, QString dataCharacteristics); | |
|
65 | QStringList generateLabels(int count); | |
|
66 | ||
|
67 | private: | |
|
68 | DataSerieDialog *m_addSerieDialog; | |
|
69 | QChart *m_chart; | |
|
70 | QChartView *m_chartView; | |
|
71 | QCheckBox *m_autoScaleCheck; | |
|
72 | QSpinBox *m_xMinSpin; | |
|
73 | QSpinBox *m_xMaxSpin; | |
|
74 | QSpinBox *m_yMinSpin; | |
|
75 | QSpinBox *m_yMaxSpin; | |
|
76 | QString m_defaultSeriesName; | |
|
77 | QGridLayout *m_scatterLayout; | |
|
78 | }; | |
|
79 | ||
|
80 | #endif // MAINWIDGET_H |
|
1 | NO CONTENT: file renamed from tests/polarcharttest/chartview.cpp to tests/manual/polarcharttest/chartview.cpp |
|
1 | NO CONTENT: file renamed from tests/polarcharttest/chartview.h to tests/manual/polarcharttest/chartview.h |
|
1 | NO CONTENT: file renamed from tests/polarcharttest/main.cpp to tests/manual/polarcharttest/main.cpp |
|
1 | NO CONTENT: file renamed from tests/polarcharttest/mainwindow.cpp to tests/manual/polarcharttest/mainwindow.cpp |
|
1 | NO CONTENT: file renamed from tests/polarcharttest/mainwindow.h to tests/manual/polarcharttest/mainwindow.h |
|
1 | NO CONTENT: file renamed from tests/polarcharttest/mainwindow.ui to tests/manual/polarcharttest/mainwindow.ui |
@@ -1,4 +1,4 | |||
|
1 | !include( ../tests.pri ) { | |
|
1 | !include( ../../tests.pri ) { | |
|
2 | 2 | error( "Couldn't find the test.pri file!" ) |
|
3 | 3 | } |
|
4 | 4 |
|
1 | NO CONTENT: file renamed from tests/presenterchart/chartview.cpp to tests/manual/presenterchart/chartview.cpp |
|
1 | NO CONTENT: file renamed from tests/presenterchart/chartview.h to tests/manual/presenterchart/chartview.h |
|
1 | NO CONTENT: file renamed from tests/presenterchart/main.cpp to tests/manual/presenterchart/main.cpp |
@@ -1,6 +1,7 | |||
|
1 | !include( ../tests.pri ) { | |
|
2 |
error( "Couldn't find the |
|
|
1 | !include( ../../tests.pri ) { | |
|
2 | error( "Couldn't find the test.pri file!" ) | |
|
3 | 3 | } |
|
4 | ||
|
4 | 5 | TARGET = presenterchart |
|
5 | 6 | HEADERS += chartview.h |
|
6 | 7 | SOURCES += main.cpp chartview.cpp |
|
1 | NO CONTENT: file renamed from tests/qmlchartaxis/main.cpp to tests/manual/qmlchartaxis/main.cpp |
|
1 | NO CONTENT: file renamed from tests/qmlchartaxis/qml/qmlchartaxis/Button.qml to tests/manual/qmlchartaxis/qml/qmlchartaxis/Button.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartaxis/qml/qmlchartaxis/ChartAxes.qml to tests/manual/qmlchartaxis/qml/qmlchartaxis/ChartAxes.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartaxis/qml/qmlchartaxis/ChartAxesRevert.qml to tests/manual/qmlchartaxis/qml/qmlchartaxis/ChartAxesRevert.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartaxis/qml/qmlchartaxis/ConfiguringDynamically.qml to tests/manual/qmlchartaxis/qml/qmlchartaxis/ConfiguringDynamically.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartaxis/qml/qmlchartaxis/CreatingDynamically.qml to tests/manual/qmlchartaxis/qml/qmlchartaxis/CreatingDynamically.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartaxis/qml/qmlchartaxis/DefaultAndUserDefined.qml to tests/manual/qmlchartaxis/qml/qmlchartaxis/DefaultAndUserDefined.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartaxis/qml/qmlchartaxis/DefaultAxes.qml to tests/manual/qmlchartaxis/qml/qmlchartaxis/DefaultAxes.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartaxis/qml/qmlchartaxis/DefaultAxesRevert.qml to tests/manual/qmlchartaxis/qml/qmlchartaxis/DefaultAxesRevert.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartaxis/qml/qmlchartaxis/Legacy.qml to tests/manual/qmlchartaxis/qml/qmlchartaxis/Legacy.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartaxis/qml/qmlchartaxis/SeriesSpecificDynamic.qml to tests/manual/qmlchartaxis/qml/qmlchartaxis/SeriesSpecificDynamic.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartaxis/qml/qmlchartaxis/SwitchingDynamically.qml to tests/manual/qmlchartaxis/qml/qmlchartaxis/SwitchingDynamically.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartaxis/qml/qmlchartaxis/UserDefined.qml to tests/manual/qmlchartaxis/qml/qmlchartaxis/UserDefined.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartaxis/qml/qmlchartaxis/UserDefinedRevert.qml to tests/manual/qmlchartaxis/qml/qmlchartaxis/UserDefinedRevert.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartaxis/qml/qmlchartaxis/main.qml to tests/manual/qmlchartaxis/qml/qmlchartaxis/main.qml |
@@ -1,4 +1,4 | |||
|
1 | !include( ../tests.pri ) { | |
|
1 | !include( ../../tests.pri ) { | |
|
2 | 2 | error( "Couldn't find the test.pri file!" ) |
|
3 | 3 | } |
|
4 | 4 |
|
1 | NO CONTENT: file renamed from tests/qmlchartaxis/resources.qrc to tests/manual/qmlchartaxis/resources.qrc |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/main.cpp to tests/manual/qmlchartproperties/main.cpp |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/AreaChart.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/AreaChart.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/AreaEditor.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/AreaEditor.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/BarChart.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/BarChart.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/BarEditor.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/BarEditor.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/Button.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/Button.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/Chart.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/Chart.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/ChartEditor.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditor.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/ChartEditorAxis.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorAxis.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/ChartEditorLegend.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorLegend.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/ChartEditorProperties.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorProperties.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/ChartEditorSeries.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorSeries.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/ChartEditorTitle.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorTitle.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/FontEditor.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/FontEditor.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/HorizontalBarChart.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/HorizontalBarChart.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/HorizontalPercentBarChart.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/HorizontalPercentBarChart.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/HorizontalStackedBarChart.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/HorizontalStackedBarChart.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/LineChart.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/LineChart.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/LineEditor.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/LineEditor.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/PercentBarChart.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/PercentBarChart.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/PieChart.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/PieChart.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/PieEditor.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/PieEditor.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/ScatterChart.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/ScatterChart.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/ScatterEditor.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/ScatterEditor.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/SplineChart.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/SplineChart.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/StackedBarChart.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/StackedBarChart.qml |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/main.qml to tests/manual/qmlchartproperties/qml/qmlchartproperties/main.qml |
@@ -1,4 +1,4 | |||
|
1 | !include( ../tests.pri ) { | |
|
1 | !include( ../../tests.pri ) { | |
|
2 | 2 | error( "Couldn't find the test.pri file!" ) |
|
3 | 3 | } |
|
4 | 4 |
|
1 | NO CONTENT: file renamed from tests/qmlchartproperties/resources.qrc to tests/manual/qmlchartproperties/resources.qrc |
|
1 | NO CONTENT: file renamed from tests/wavechart/main.cpp to tests/manual/wavechart/main.cpp |
|
1 | NO CONTENT: file renamed from tests/wavechart/wavechart.cpp to tests/manual/wavechart/wavechart.cpp |
|
1 | NO CONTENT: file renamed from tests/wavechart/wavechart.h to tests/manual/wavechart/wavechart.h |
@@ -1,6 +1,7 | |||
|
1 | !include( ../tests.pri ) { | |
|
2 |
error( "Couldn't find the |
|
|
1 | !include( ../../tests.pri ) { | |
|
2 | error( "Couldn't find the test.pri file!" ) | |
|
3 | 3 | } |
|
4 | ||
|
4 | 5 | QT+=opengl |
|
5 | 6 | TARGET = wavechart |
|
6 | 7 | SOURCES += main.cpp wavechart.cpp |
@@ -1,19 +1,3 | |||
|
1 | 1 | TEMPLATE = subdirs |
|
2 |
SUBDIRS += |
|
|
3 | auto \ | |
|
4 | presenterchart \ | |
|
5 | polarcharttest \ | |
|
6 | boxplottester | |
|
7 | ||
|
8 | contains(QT_CONFIG, opengl) { | |
|
9 | SUBDIRS += chartwidgettest \ | |
|
10 | wavechart \ | |
|
11 | chartviewer | |
|
12 | } else { | |
|
13 | message("OpenGL not available. Some test apps are disabled") | |
|
14 | } | |
|
15 | ||
|
16 | qtHaveModule(quick) { | |
|
17 | SUBDIRS += qmlchartproperties \ | |
|
18 | qmlchartaxis | |
|
19 | } | |
|
2 | SUBDIRS += auto | |
|
3 | exists(manual): SUBDIRS += manual |
General Comments 0
You need to be logged in to leave comments.
Login now