1 | /**************************************************************************** |
2 | ** |
3 | ** Copyright (C) 2016 The Qt Company Ltd. |
4 | ** Contact: https://www.qt.io/licensing/ |
5 | ** |
6 | ** This file is part of the Qt Data Visualization module of the Qt Toolkit. |
7 | ** |
8 | ** $QT_BEGIN_LICENSE:GPL$ |
9 | ** Commercial License Usage |
10 | ** Licensees holding valid commercial Qt licenses may use this file in |
11 | ** accordance with the commercial license agreement provided with the |
12 | ** Software or, alternatively, in accordance with the terms contained in |
13 | ** a written agreement between you and The Qt Company. For licensing terms |
14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
15 | ** information use the contact form at https://www.qt.io/contact-us. |
16 | ** |
17 | ** GNU General Public License Usage |
18 | ** Alternatively, this file may be used under the terms of the GNU |
19 | ** General Public License version 3 or (at your option) any later version |
20 | ** approved by the KDE Free Qt Foundation. The licenses are as published by |
21 | ** the Free Software Foundation and appearing in the file LICENSE.GPL3 |
22 | ** included in the packaging of this file. Please review the following |
23 | ** information to ensure the GNU General Public License requirements will |
24 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. |
25 | ** |
26 | ** $QT_END_LICENSE$ |
27 | ** |
28 | ****************************************************************************/ |
29 | |
30 | #include "chart.h" |
31 | |
32 | #include <QApplication> |
33 | #include <QWidget> |
34 | #include <QHBoxLayout> |
35 | #include <QVBoxLayout> |
36 | #include <QPushButton> |
37 | #include <QCheckBox> |
38 | #include <QSlider> |
39 | #include <QFontComboBox> |
40 | #include <QLabel> |
41 | #include <QScreen> |
42 | #include <QFontDatabase> |
43 | #include <QLinearGradient> |
44 | #include <QPainter> |
45 | #include <QColorDialog> |
46 | #include <QLineEdit> |
47 | #include <QSpinBox> |
48 | #include <QtGui/QOpenGLContext> |
49 | #include <QtDataVisualization/QCustom3DItem> |
50 | #include <QtDataVisualization/QCustom3DLabel> |
51 | #include <QtDataVisualization/QCustom3DVolume> |
52 | |
53 | int main(int argc, char **argv) |
54 | { |
55 | QApplication app(argc, argv); |
56 | |
57 | // Test creating custom items before graph is created |
58 | QCustom3DItem customItem; |
59 | QCustom3DLabel customLabel; |
60 | QCustom3DVolume customVolume; |
61 | |
62 | QWidget *widget = new QWidget; |
63 | QHBoxLayout *hLayout = new QHBoxLayout(widget); |
64 | QVBoxLayout *vLayout = new QVBoxLayout(); |
65 | QVBoxLayout *vLayout2 = new QVBoxLayout(); |
66 | QVBoxLayout *vLayout3 = new QVBoxLayout(); |
67 | |
68 | // For testing custom surface format |
69 | QSurfaceFormat surfaceFormat; |
70 | surfaceFormat.setDepthBufferSize(24); |
71 | surfaceFormat.setSamples(8); |
72 | |
73 | Q3DBars *widgetchart = new Q3DBars(&surfaceFormat); |
74 | QSize screenSize = widgetchart->screen()->size(); |
75 | |
76 | QWidget *container = QWidget::createWindowContainer(window: widgetchart); |
77 | container->setMinimumSize(QSize(screenSize.width() / 3, screenSize.height() / 3)); |
78 | container->setMaximumSize(screenSize); |
79 | container->setSizePolicy(hor: QSizePolicy::Expanding, ver: QSizePolicy::Expanding); |
80 | container->setFocusPolicy(Qt::StrongFocus); |
81 | |
82 | widget->setWindowTitle(QStringLiteral("Average temperatures in Oulu, Finland (2006-2012)" )); |
83 | |
84 | hLayout->addWidget(container, stretch: 1); |
85 | hLayout->addLayout(layout: vLayout); |
86 | hLayout->addLayout(layout: vLayout2); |
87 | hLayout->addLayout(layout: vLayout3); |
88 | |
89 | QPushButton *addSeriesButton = new QPushButton(widget); |
90 | addSeriesButton->setText(QStringLiteral("Add / Remove a series" )); |
91 | addSeriesButton->setEnabled(true); |
92 | |
93 | QPushButton *addDataButton = new QPushButton(widget); |
94 | addDataButton->setText(QStringLiteral("Add a row of data" )); |
95 | addDataButton->setEnabled(false); |
96 | |
97 | QPushButton *addMultiDataButton = new QPushButton(widget); |
98 | addMultiDataButton->setText(QStringLiteral("Add many rows of data" )); |
99 | addMultiDataButton->setEnabled(false); |
100 | |
101 | QPushButton *insertDataButton = new QPushButton(widget); |
102 | insertDataButton->setText(QStringLiteral("Insert a row of data" )); |
103 | insertDataButton->setEnabled(false); |
104 | |
105 | QPushButton *insertMultiDataButton = new QPushButton(widget); |
106 | insertMultiDataButton->setText(QStringLiteral("Insert many rows of data" )); |
107 | insertMultiDataButton->setEnabled(false); |
108 | |
109 | QPushButton *changeSingleDataButton = new QPushButton(widget); |
110 | changeSingleDataButton->setText(QStringLiteral("Change selected bar value" )); |
111 | changeSingleDataButton->setEnabled(false); |
112 | |
113 | QPushButton *changeRowButton = new QPushButton(widget); |
114 | changeRowButton->setText(QStringLiteral("Change selected row values" )); |
115 | changeRowButton->setEnabled(false); |
116 | |
117 | QPushButton *changeRowsButton = new QPushButton(widget); |
118 | changeRowsButton->setText(QStringLiteral("Change three rows from selected" )); |
119 | changeRowsButton->setEnabled(false); |
120 | |
121 | QPushButton *removeRowButton = new QPushButton(widget); |
122 | removeRowButton->setText(QStringLiteral("Remove selected row" )); |
123 | removeRowButton->setEnabled(false); |
124 | |
125 | QPushButton *removeRowsButton = new QPushButton(widget); |
126 | removeRowsButton->setText(QStringLiteral("Remove three rows before selected" )); |
127 | removeRowsButton->setEnabled(false); |
128 | |
129 | QPushButton *massiveArrayButton = new QPushButton(widget); |
130 | massiveArrayButton->setText(QStringLiteral("Create massive array" )); |
131 | massiveArrayButton->setEnabled(false); |
132 | |
133 | QPushButton *themeButton = new QPushButton(widget); |
134 | themeButton->setText(QStringLiteral("Change theme" )); |
135 | |
136 | QPushButton *labelButton = new QPushButton(widget); |
137 | labelButton->setText(QStringLiteral("Change label style" )); |
138 | |
139 | QPushButton *multiScaleButton = new QPushButton(widget); |
140 | multiScaleButton->setText(QStringLiteral("Change multiseries scaling" )); |
141 | |
142 | QPushButton *styleButton = new QPushButton(widget); |
143 | styleButton->setText(QStringLiteral("Change bar style" )); |
144 | |
145 | QPushButton *cameraButton = new QPushButton(widget); |
146 | cameraButton->setText(QStringLiteral("Change camera preset" )); |
147 | |
148 | QPushButton *selectionButton = new QPushButton(widget); |
149 | selectionButton->setText(QStringLiteral("Change selection mode" )); |
150 | |
151 | QPushButton *setSelectedBarButton = new QPushButton(widget); |
152 | setSelectedBarButton->setText(QStringLiteral("Select/deselect bar at (5,5)" )); |
153 | |
154 | QPushButton *swapAxisButton = new QPushButton(widget); |
155 | swapAxisButton->setText(QStringLiteral("Swap value axis" )); |
156 | swapAxisButton->setEnabled(false); |
157 | |
158 | QPushButton *insertRemoveTestButton = new QPushButton(widget); |
159 | insertRemoveTestButton->setText(QStringLiteral("Toggle insert/remove cycle" )); |
160 | insertRemoveTestButton->setEnabled(true); |
161 | |
162 | QPushButton *releaseAxesButton = new QPushButton(widget); |
163 | releaseAxesButton->setText(QStringLiteral("Release all axes" )); |
164 | releaseAxesButton->setEnabled(true); |
165 | |
166 | QPushButton *releaseProxiesButton = new QPushButton(widget); |
167 | releaseProxiesButton->setText(QStringLiteral("Release all proxies" )); |
168 | releaseProxiesButton->setEnabled(true); |
169 | |
170 | QPushButton *flipViewsButton = new QPushButton(widget); |
171 | flipViewsButton->setText(QStringLiteral("Flip views" )); |
172 | flipViewsButton->setEnabled(true); |
173 | |
174 | QPushButton *showFiveSeriesButton = new QPushButton(widget); |
175 | showFiveSeriesButton->setText(QStringLiteral("Try 5 series" )); |
176 | showFiveSeriesButton->setEnabled(true); |
177 | |
178 | QPushButton *changeColorStyleButton = new QPushButton(widget); |
179 | changeColorStyleButton->setText(QStringLiteral("Change color style" )); |
180 | changeColorStyleButton->setEnabled(true); |
181 | |
182 | QPushButton *ownThemeButton = new QPushButton(widget); |
183 | ownThemeButton->setText(QStringLiteral("Use own theme" )); |
184 | ownThemeButton->setEnabled(true); |
185 | |
186 | QPushButton *primarySeriesTestsButton = new QPushButton(widget); |
187 | primarySeriesTestsButton->setText(QStringLiteral("Test primary series" )); |
188 | primarySeriesTestsButton->setEnabled(true); |
189 | |
190 | QPushButton *toggleRotationButton = new QPushButton(widget); |
191 | toggleRotationButton->setText(QStringLiteral("Toggle rotation" )); |
192 | toggleRotationButton->setEnabled(true); |
193 | |
194 | QPushButton *logAxisButton = new QPushButton(widget); |
195 | logAxisButton->setText(QStringLiteral("Use Log Axis" )); |
196 | logAxisButton->setEnabled(true); |
197 | |
198 | QPushButton *testItemAndRowChangesButton = new QPushButton(widget); |
199 | testItemAndRowChangesButton->setText(QStringLiteral("Test Item/Row changing" )); |
200 | testItemAndRowChangesButton->setEnabled(true); |
201 | |
202 | QColorDialog *colorDialog = new QColorDialog(widget); |
203 | |
204 | QLinearGradient grBtoY(0, 0, 100, 0); |
205 | grBtoY.setColorAt(pos: 1.0, color: Qt::black); |
206 | grBtoY.setColorAt(pos: 0.67, color: Qt::blue); |
207 | grBtoY.setColorAt(pos: 0.33, color: Qt::red); |
208 | grBtoY.setColorAt(pos: 0.0, color: Qt::yellow); |
209 | QPixmap pm(100, 24); |
210 | QPainter pmp(&pm); |
211 | pmp.setBrush(QBrush(grBtoY)); |
212 | pmp.setPen(Qt::NoPen); |
213 | pmp.drawRect(x: 0, y: 0, w: 100, h: 24); |
214 | QPushButton *gradientBtoYPB = new QPushButton(widget); |
215 | gradientBtoYPB->setIcon(QIcon(pm)); |
216 | gradientBtoYPB->setIconSize(QSize(100, 24)); |
217 | |
218 | QLabel *fpsLabel = new QLabel(QStringLiteral("" )); |
219 | |
220 | QCheckBox *fpsCheckBox = new QCheckBox(widget); |
221 | fpsCheckBox->setText(QStringLiteral("Measure Fps" )); |
222 | fpsCheckBox->setChecked(false); |
223 | |
224 | QCheckBox *reverseValueAxisCheckBox = new QCheckBox(widget); |
225 | reverseValueAxisCheckBox->setText(QStringLiteral("Reverse value axis" )); |
226 | reverseValueAxisCheckBox->setChecked(false); |
227 | |
228 | QCheckBox *backgroundCheckBox = new QCheckBox(widget); |
229 | backgroundCheckBox->setText(QStringLiteral("Show background" )); |
230 | backgroundCheckBox->setChecked(true); |
231 | |
232 | QCheckBox *gridCheckBox = new QCheckBox(widget); |
233 | gridCheckBox->setText(QStringLiteral("Show grid" )); |
234 | gridCheckBox->setChecked(true); |
235 | |
236 | QCheckBox *rotationCheckBox = new QCheckBox(widget); |
237 | rotationCheckBox->setText("Rotate with slider" ); |
238 | |
239 | QCheckBox *staticCheckBox = new QCheckBox(widget); |
240 | staticCheckBox->setText("Use dynamic data" ); |
241 | staticCheckBox->setChecked(false); |
242 | |
243 | QCheckBox *inputHandlerRotationCheckBox = new QCheckBox(widget); |
244 | inputHandlerRotationCheckBox->setText("IH: Allow rotation" ); |
245 | inputHandlerRotationCheckBox->setChecked(true); |
246 | |
247 | QCheckBox *inputHandlerZoomCheckBox = new QCheckBox(widget); |
248 | inputHandlerZoomCheckBox->setText("IH: Allow zoom" ); |
249 | inputHandlerZoomCheckBox->setChecked(true); |
250 | |
251 | QCheckBox *inputHandlerSelectionCheckBox = new QCheckBox(widget); |
252 | inputHandlerSelectionCheckBox->setText("IH: Allow selection" ); |
253 | inputHandlerSelectionCheckBox->setChecked(true); |
254 | |
255 | QCheckBox *inputHandlerZoomAtTargetCheckBox = new QCheckBox(widget); |
256 | inputHandlerZoomAtTargetCheckBox->setText("IH: setZoomAtTarget" ); |
257 | inputHandlerZoomAtTargetCheckBox->setChecked(true); |
258 | |
259 | QSlider *rotationSliderX = new QSlider(Qt::Horizontal, widget); |
260 | rotationSliderX->setTickInterval(1); |
261 | rotationSliderX->setMinimum(-180); |
262 | rotationSliderX->setValue(0); |
263 | rotationSliderX->setMaximum(180); |
264 | rotationSliderX->setEnabled(false); |
265 | QSlider *rotationSliderY = new QSlider(Qt::Horizontal, widget); |
266 | rotationSliderY->setTickInterval(1); |
267 | rotationSliderY->setMinimum(0); |
268 | rotationSliderY->setValue(0); |
269 | rotationSliderY->setMaximum(90); |
270 | rotationSliderY->setEnabled(false); |
271 | |
272 | QSlider *ratioSlider = new QSlider(Qt::Horizontal, widget); |
273 | ratioSlider->setTickInterval(1); |
274 | ratioSlider->setMinimum(10); |
275 | ratioSlider->setValue(30); |
276 | ratioSlider->setMaximum(100); |
277 | |
278 | QCheckBox *reflectionCheckBox = new QCheckBox(widget); |
279 | reflectionCheckBox->setText(QStringLiteral("Show reflections" )); |
280 | reflectionCheckBox->setChecked(false); |
281 | |
282 | QSlider *reflectivitySlider = new QSlider(Qt::Horizontal, widget); |
283 | reflectivitySlider->setMinimum(0); |
284 | reflectivitySlider->setValue(50); |
285 | reflectivitySlider->setMaximum(100); |
286 | |
287 | QSlider *floorLevelSlider = new QSlider(Qt::Horizontal, widget); |
288 | floorLevelSlider->setMinimum(-50); |
289 | floorLevelSlider->setValue(0); |
290 | floorLevelSlider->setMaximum(50); |
291 | |
292 | QPushButton *toggleCustomItemButton = new QPushButton(widget); |
293 | toggleCustomItemButton->setText(QStringLiteral("Toggle Custom Item" )); |
294 | |
295 | QSlider *spacingSliderX = new QSlider(Qt::Horizontal, widget); |
296 | spacingSliderX->setTickInterval(1); |
297 | spacingSliderX->setMinimum(0); |
298 | spacingSliderX->setValue(10); |
299 | spacingSliderX->setMaximum(200); |
300 | QSlider *spacingSliderZ = new QSlider(Qt::Horizontal, widget); |
301 | spacingSliderZ->setTickInterval(1); |
302 | spacingSliderZ->setMinimum(0); |
303 | spacingSliderZ->setValue(10); |
304 | spacingSliderZ->setMaximum(200); |
305 | |
306 | QSlider *sampleSliderX = new QSlider(Qt::Horizontal, widget); |
307 | sampleSliderX->setTickInterval(1); |
308 | sampleSliderX->setMinimum(1); |
309 | sampleSliderX->setValue(21); |
310 | sampleSliderX->setMaximum(200); |
311 | sampleSliderX->setEnabled(false); |
312 | QSlider *sampleSliderZ = new QSlider(Qt::Horizontal, widget); |
313 | sampleSliderZ->setTickInterval(1); |
314 | sampleSliderZ->setMinimum(1); |
315 | sampleSliderZ->setValue(21); |
316 | sampleSliderZ->setMaximum(200); |
317 | sampleSliderZ->setEnabled(false); |
318 | |
319 | QSlider *minSliderX = new QSlider(Qt::Horizontal, widget); |
320 | minSliderX->setTickInterval(10); |
321 | minSliderX->setTickPosition(QSlider::TicksBelow); |
322 | minSliderX->setMinimum(0); |
323 | minSliderX->setValue(0); |
324 | minSliderX->setMaximum(200); |
325 | minSliderX->setEnabled(false); |
326 | QSlider *minSliderZ = new QSlider(Qt::Horizontal, widget); |
327 | minSliderZ->setTickInterval(10); |
328 | minSliderZ->setTickPosition(QSlider::TicksAbove); |
329 | minSliderZ->setMinimum(0); |
330 | minSliderZ->setValue(0); |
331 | minSliderZ->setMaximum(200); |
332 | minSliderZ->setEnabled(false); |
333 | QSlider *minSliderY = new QSlider(Qt::Horizontal, widget); |
334 | minSliderY->setTickInterval(10); |
335 | minSliderY->setTickPosition(QSlider::TicksBelow); |
336 | minSliderY->setMinimum(-100); |
337 | minSliderY->setValue(0); |
338 | minSliderY->setMaximum(100); |
339 | minSliderY->setEnabled(false); |
340 | QSlider *maxSliderY = new QSlider(Qt::Horizontal, widget); |
341 | maxSliderY->setTickInterval(10); |
342 | maxSliderY->setTickPosition(QSlider::TicksAbove); |
343 | maxSliderY->setMinimum(-50); |
344 | maxSliderY->setValue(100); |
345 | maxSliderY->setMaximum(200); |
346 | maxSliderY->setEnabled(false); |
347 | |
348 | QSlider *fontSizeSlider = new QSlider(Qt::Horizontal, widget); |
349 | fontSizeSlider->setTickInterval(1); |
350 | fontSizeSlider->setMinimum(1); |
351 | fontSizeSlider->setValue(20); |
352 | fontSizeSlider->setMaximum(100); |
353 | |
354 | QFontComboBox *fontList = new QFontComboBox(widget); |
355 | |
356 | QComboBox *shadowQuality = new QComboBox(widget); |
357 | shadowQuality->addItem(QStringLiteral("None" )); |
358 | shadowQuality->addItem(QStringLiteral("Low" )); |
359 | shadowQuality->addItem(QStringLiteral("Medium" )); |
360 | shadowQuality->addItem(QStringLiteral("High" )); |
361 | shadowQuality->addItem(QStringLiteral("Low Soft" )); |
362 | shadowQuality->addItem(QStringLiteral("Medium Soft" )); |
363 | shadowQuality->addItem(QStringLiteral("High Soft" )); |
364 | shadowQuality->setCurrentIndex(5); |
365 | |
366 | QLineEdit *valueAxisFormatEdit = new QLineEdit(widget); |
367 | QLineEdit *logBaseEdit = new QLineEdit(widget); |
368 | QSpinBox *valueAxisSegmentsSpin = new QSpinBox(widget); |
369 | valueAxisSegmentsSpin->setMinimum(1); |
370 | valueAxisSegmentsSpin->setMaximum(100); |
371 | valueAxisSegmentsSpin->setValue(10); |
372 | |
373 | QSlider *cameraTargetSliderX = new QSlider(Qt::Horizontal, widget); |
374 | cameraTargetSliderX->setTickInterval(1); |
375 | cameraTargetSliderX->setMinimum(-100); |
376 | cameraTargetSliderX->setValue(0); |
377 | cameraTargetSliderX->setMaximum(100); |
378 | QSlider *cameraTargetSliderY = new QSlider(Qt::Horizontal, widget); |
379 | cameraTargetSliderY->setTickInterval(1); |
380 | cameraTargetSliderY->setMinimum(-100); |
381 | cameraTargetSliderY->setValue(0); |
382 | cameraTargetSliderY->setMaximum(100); |
383 | QSlider *cameraTargetSliderZ = new QSlider(Qt::Horizontal, widget); |
384 | cameraTargetSliderZ->setTickInterval(1); |
385 | cameraTargetSliderZ->setMinimum(-100); |
386 | cameraTargetSliderZ->setValue(0); |
387 | cameraTargetSliderZ->setMaximum(100); |
388 | |
389 | QSlider *marginSlider = new QSlider(Qt::Horizontal, widget); |
390 | marginSlider->setMinimum(-1); |
391 | marginSlider->setValue(-1); |
392 | marginSlider->setMaximum(100); |
393 | |
394 | vLayout->addWidget(addSeriesButton, stretch: 0, alignment: Qt::AlignTop); |
395 | vLayout->addWidget(addDataButton, stretch: 0, alignment: Qt::AlignTop); |
396 | vLayout->addWidget(addMultiDataButton, stretch: 0, alignment: Qt::AlignTop); |
397 | vLayout->addWidget(insertDataButton, stretch: 0, alignment: Qt::AlignTop); |
398 | vLayout->addWidget(insertMultiDataButton, stretch: 0, alignment: Qt::AlignTop); |
399 | vLayout->addWidget(changeSingleDataButton, stretch: 0, alignment: Qt::AlignTop); |
400 | vLayout->addWidget(changeRowButton, stretch: 0, alignment: Qt::AlignTop); |
401 | vLayout->addWidget(changeRowsButton, stretch: 0, alignment: Qt::AlignTop); |
402 | vLayout->addWidget(removeRowButton, stretch: 0, alignment: Qt::AlignTop); |
403 | vLayout->addWidget(removeRowsButton, stretch: 0, alignment: Qt::AlignTop); |
404 | vLayout->addWidget(massiveArrayButton, stretch: 0, alignment: Qt::AlignTop); |
405 | vLayout->addWidget(showFiveSeriesButton, stretch: 0, alignment: Qt::AlignTop); |
406 | vLayout->addWidget(themeButton, stretch: 0, alignment: Qt::AlignTop); |
407 | vLayout->addWidget(labelButton, stretch: 0, alignment: Qt::AlignTop); |
408 | vLayout->addWidget(multiScaleButton, stretch: 0, alignment: Qt::AlignTop); |
409 | vLayout->addWidget(styleButton, stretch: 0, alignment: Qt::AlignTop); |
410 | vLayout->addWidget(cameraButton, stretch: 0, alignment: Qt::AlignTop); |
411 | vLayout->addWidget(selectionButton, stretch: 0, alignment: Qt::AlignTop); |
412 | vLayout->addWidget(setSelectedBarButton, stretch: 0, alignment: Qt::AlignTop); |
413 | vLayout->addWidget(swapAxisButton, stretch: 0, alignment: Qt::AlignTop); |
414 | vLayout->addWidget(insertRemoveTestButton, stretch: 0, alignment: Qt::AlignTop); |
415 | vLayout->addWidget(releaseAxesButton, stretch: 0, alignment: Qt::AlignTop); |
416 | vLayout->addWidget(releaseProxiesButton, stretch: 1, alignment: Qt::AlignTop); |
417 | |
418 | vLayout2->addWidget(flipViewsButton, stretch: 0, alignment: Qt::AlignTop); |
419 | vLayout2->addWidget(changeColorStyleButton, stretch: 0, alignment: Qt::AlignTop); |
420 | vLayout2->addWidget(ownThemeButton, stretch: 0, alignment: Qt::AlignTop); |
421 | vLayout2->addWidget(primarySeriesTestsButton, stretch: 0, alignment: Qt::AlignTop); |
422 | vLayout2->addWidget(toggleRotationButton, stretch: 0, alignment: Qt::AlignTop); |
423 | vLayout2->addWidget(gradientBtoYPB, stretch: 0, alignment: Qt::AlignTop); |
424 | vLayout2->addWidget(logAxisButton, stretch: 0, alignment: Qt::AlignTop); |
425 | vLayout2->addWidget(testItemAndRowChangesButton, stretch: 0, alignment: Qt::AlignTop); |
426 | vLayout2->addWidget(staticCheckBox, stretch: 0, alignment: Qt::AlignTop); |
427 | vLayout2->addWidget(rotationCheckBox, stretch: 0, alignment: Qt::AlignTop); |
428 | vLayout2->addWidget(rotationSliderX, stretch: 0, alignment: Qt::AlignTop); |
429 | vLayout2->addWidget(rotationSliderY, stretch: 0, alignment: Qt::AlignTop); |
430 | vLayout2->addWidget(new QLabel(QStringLiteral("Adjust relative bar size" )), stretch: 0, alignment: Qt::AlignTop); |
431 | vLayout2->addWidget(ratioSlider, stretch: 0, alignment: Qt::AlignTop); |
432 | vLayout2->addWidget(new QLabel(QStringLiteral("Adjust relative bar spacing" )), stretch: 0, alignment: Qt::AlignTop); |
433 | vLayout2->addWidget(spacingSliderX, stretch: 0, alignment: Qt::AlignTop); |
434 | vLayout2->addWidget(spacingSliderZ, stretch: 0, alignment: Qt::AlignTop); |
435 | vLayout2->addWidget(new QLabel(QStringLiteral("Adjust sample count" )), stretch: 0, alignment: Qt::AlignTop); |
436 | vLayout2->addWidget(sampleSliderX, stretch: 0, alignment: Qt::AlignTop); |
437 | vLayout2->addWidget(sampleSliderZ, stretch: 0, alignment: Qt::AlignTop); |
438 | vLayout2->addWidget(new QLabel(QStringLiteral("Adjust data window minimums" )), stretch: 0, alignment: Qt::AlignTop); |
439 | vLayout2->addWidget(minSliderX, stretch: 0, alignment: Qt::AlignTop); |
440 | vLayout2->addWidget(minSliderZ, stretch: 0, alignment: Qt::AlignTop); |
441 | vLayout2->addWidget(minSliderY, stretch: 0, alignment: Qt::AlignTop); |
442 | vLayout2->addWidget(maxSliderY, stretch: 1, alignment: Qt::AlignTop); |
443 | |
444 | vLayout3->addWidget(fpsLabel, stretch: 0, alignment: Qt::AlignTop); |
445 | vLayout3->addWidget(fpsCheckBox, stretch: 0, alignment: Qt::AlignTop); |
446 | vLayout3->addWidget(reverseValueAxisCheckBox, stretch: 0, alignment: Qt::AlignTop); |
447 | vLayout3->addWidget(backgroundCheckBox, stretch: 0, alignment: Qt::AlignTop); |
448 | vLayout3->addWidget(gridCheckBox, stretch: 0, alignment: Qt::AlignTop); |
449 | vLayout3->addWidget(inputHandlerRotationCheckBox, stretch: 0, alignment: Qt::AlignTop); |
450 | vLayout3->addWidget(inputHandlerZoomCheckBox, stretch: 0, alignment: Qt::AlignTop); |
451 | vLayout3->addWidget(inputHandlerSelectionCheckBox, stretch: 0, alignment: Qt::AlignTop); |
452 | vLayout3->addWidget(inputHandlerZoomAtTargetCheckBox, stretch: 0, alignment: Qt::AlignTop); |
453 | vLayout3->addWidget(new QLabel(QStringLiteral("Adjust shadow quality" )), stretch: 0, alignment: Qt::AlignTop); |
454 | vLayout3->addWidget(shadowQuality, stretch: 0, alignment: Qt::AlignTop); |
455 | vLayout3->addWidget(new QLabel(QStringLiteral("Change font" )), stretch: 0, alignment: Qt::AlignTop); |
456 | vLayout3->addWidget(fontList, stretch: 0, alignment: Qt::AlignTop); |
457 | vLayout3->addWidget(new QLabel(QStringLiteral("Adjust font size" )), stretch: 0, alignment: Qt::AlignTop); |
458 | vLayout3->addWidget(fontSizeSlider, stretch: 0, alignment: Qt::AlignTop); |
459 | vLayout3->addWidget(new QLabel(QStringLiteral("Value axis format" )), stretch: 0, alignment: Qt::AlignTop); |
460 | vLayout3->addWidget(valueAxisFormatEdit, stretch: 0, alignment: Qt::AlignTop); |
461 | vLayout3->addWidget(new QLabel(QStringLiteral("Log axis base" )), stretch: 0, alignment: Qt::AlignTop); |
462 | vLayout3->addWidget(logBaseEdit, stretch: 0, alignment: Qt::AlignTop); |
463 | vLayout3->addWidget(new QLabel(QStringLiteral("Value axis segments" )), stretch: 0, alignment: Qt::AlignTop); |
464 | vLayout3->addWidget(valueAxisSegmentsSpin, stretch: 0, alignment: Qt::AlignTop); |
465 | vLayout3->addWidget(new QLabel(QStringLiteral("Camera target" )), stretch: 0, alignment: Qt::AlignTop); |
466 | vLayout3->addWidget(cameraTargetSliderX, stretch: 0, alignment: Qt::AlignTop); |
467 | vLayout3->addWidget(cameraTargetSliderY, stretch: 0, alignment: Qt::AlignTop); |
468 | vLayout3->addWidget(cameraTargetSliderZ, stretch: 0, alignment: Qt::AlignTop); |
469 | vLayout3->addWidget(reflectionCheckBox, stretch: 0, alignment: Qt::AlignTop); |
470 | vLayout3->addWidget(reflectivitySlider, stretch: 0, alignment: Qt::AlignTop); |
471 | vLayout3->addWidget(toggleCustomItemButton, stretch: 0, alignment: Qt::AlignTop); |
472 | vLayout3->addWidget(new QLabel(QStringLiteral("Adjust floor level" )), stretch: 0, alignment: Qt::AlignTop); |
473 | vLayout3->addWidget(floorLevelSlider, stretch: 0, alignment: Qt::AlignTop); |
474 | vLayout3->addWidget(new QLabel(QStringLiteral("Adjust margin" )), stretch: 0, alignment: Qt::AlignTop); |
475 | vLayout3->addWidget(marginSlider, stretch: 1, alignment: Qt::AlignTop); |
476 | |
477 | widget->show(); |
478 | |
479 | GraphModifier *modifier = new GraphModifier(widgetchart, colorDialog); |
480 | |
481 | QObject::connect(sender: rotationSliderX, signal: &QSlider::valueChanged, receiver: modifier, slot: &GraphModifier::rotateX); |
482 | QObject::connect(sender: rotationSliderY, signal: &QSlider::valueChanged, receiver: modifier, slot: &GraphModifier::rotateY); |
483 | |
484 | QObject::connect(sender: ratioSlider, signal: &QSlider::valueChanged, receiver: modifier, slot: &GraphModifier::setSpecsRatio); |
485 | |
486 | QObject::connect(sender: spacingSliderX, signal: &QSlider::valueChanged, receiver: modifier, |
487 | slot: &GraphModifier::setSpacingSpecsX); |
488 | QObject::connect(sender: spacingSliderZ, signal: &QSlider::valueChanged, receiver: modifier, |
489 | slot: &GraphModifier::setSpacingSpecsZ); |
490 | |
491 | QObject::connect(sender: sampleSliderX, signal: &QSlider::valueChanged, receiver: modifier, |
492 | slot: &GraphModifier::setSampleCountX); |
493 | QObject::connect(sender: sampleSliderZ, signal: &QSlider::valueChanged, receiver: modifier, |
494 | slot: &GraphModifier::setSampleCountZ); |
495 | QObject::connect(sender: minSliderX, signal: &QSlider::valueChanged, receiver: modifier, |
496 | slot: &GraphModifier::setMinX); |
497 | QObject::connect(sender: minSliderZ, signal: &QSlider::valueChanged, receiver: modifier, |
498 | slot: &GraphModifier::setMinZ); |
499 | QObject::connect(sender: minSliderY, signal: &QSlider::valueChanged, receiver: modifier, |
500 | slot: &GraphModifier::setMinY); |
501 | QObject::connect(sender: maxSliderY, signal: &QSlider::valueChanged, receiver: modifier, |
502 | slot: &GraphModifier::setMaxY); |
503 | QObject::connect(sender: cameraTargetSliderX, signal: &QSlider::valueChanged, receiver: modifier, |
504 | slot: &GraphModifier::setCameraTargetX); |
505 | QObject::connect(sender: cameraTargetSliderY, signal: &QSlider::valueChanged, receiver: modifier, |
506 | slot: &GraphModifier::setCameraTargetY); |
507 | QObject::connect(sender: cameraTargetSliderZ, signal: &QSlider::valueChanged, receiver: modifier, |
508 | slot: &GraphModifier::setCameraTargetZ); |
509 | |
510 | QObject::connect(sender: shadowQuality, SIGNAL(currentIndexChanged(int)), receiver: modifier, |
511 | SLOT(changeShadowQuality(int))); |
512 | QObject::connect(sender: modifier, signal: &GraphModifier::shadowQualityChanged, receiver: shadowQuality, |
513 | slot: &QComboBox::setCurrentIndex); |
514 | QObject::connect(sender: fontSizeSlider, signal: &QSlider::valueChanged, receiver: modifier, |
515 | slot: &GraphModifier::changeFontSize); |
516 | QObject::connect(sender: valueAxisFormatEdit, signal: &QLineEdit::textEdited, receiver: modifier, |
517 | slot: &GraphModifier::changeValueAxisFormat); |
518 | QObject::connect(sender: logBaseEdit, signal: &QLineEdit::textEdited, receiver: modifier, |
519 | slot: &GraphModifier::changeLogBase); |
520 | QObject::connect(sender: valueAxisSegmentsSpin, SIGNAL(valueChanged(int)), receiver: modifier, |
521 | SLOT(changeValueAxisSegments(int))); |
522 | |
523 | QObject::connect(sender: multiScaleButton, signal: &QPushButton::clicked, receiver: modifier, |
524 | slot: &GraphModifier::toggleMultiseriesScaling); |
525 | QObject::connect(sender: styleButton, signal: &QPushButton::clicked, receiver: modifier, slot: &GraphModifier::changeStyle); |
526 | QObject::connect(sender: cameraButton, signal: &QPushButton::clicked, receiver: modifier, |
527 | slot: &GraphModifier::changePresetCamera); |
528 | QObject::connect(sender: themeButton, signal: &QPushButton::clicked, receiver: modifier, slot: &GraphModifier::changeTheme); |
529 | QObject::connect(sender: labelButton, signal: &QPushButton::clicked, receiver: modifier, |
530 | slot: &GraphModifier::changeLabelStyle); |
531 | QObject::connect(sender: addDataButton, signal: &QPushButton::clicked, receiver: modifier, slot: &GraphModifier::addRow); |
532 | QObject::connect(sender: addSeriesButton, signal: &QPushButton::clicked, receiver: modifier, slot: &GraphModifier::addRemoveSeries); |
533 | QObject::connect(sender: addMultiDataButton, signal: &QPushButton::clicked, receiver: modifier, slot: &GraphModifier::addRows); |
534 | QObject::connect(sender: insertDataButton, signal: &QPushButton::clicked, receiver: modifier, slot: &GraphModifier::insertRow); |
535 | QObject::connect(sender: insertMultiDataButton, signal: &QPushButton::clicked, receiver: modifier, slot: &GraphModifier::insertRows); |
536 | QObject::connect(sender: changeSingleDataButton, signal: &QPushButton::clicked, receiver: modifier, slot: &GraphModifier::changeItem); |
537 | QObject::connect(sender: changeRowButton, signal: &QPushButton::clicked, receiver: modifier, slot: &GraphModifier::changeRow); |
538 | QObject::connect(sender: changeRowsButton, signal: &QPushButton::clicked, receiver: modifier, slot: &GraphModifier::changeRows); |
539 | QObject::connect(sender: removeRowButton, signal: &QPushButton::clicked, receiver: modifier, slot: &GraphModifier::removeRow); |
540 | QObject::connect(sender: removeRowsButton, signal: &QPushButton::clicked, receiver: modifier, slot: &GraphModifier::removeRows); |
541 | QObject::connect(sender: massiveArrayButton, signal: &QPushButton::clicked, receiver: modifier, slot: &GraphModifier::createMassiveArray); |
542 | QObject::connect(sender: showFiveSeriesButton, signal: &QPushButton::clicked, receiver: modifier, slot: &GraphModifier::showFiveSeries); |
543 | QObject::connect(sender: selectionButton, signal: &QPushButton::clicked, receiver: modifier, |
544 | slot: &GraphModifier::changeSelectionMode); |
545 | QObject::connect(sender: setSelectedBarButton, signal: &QPushButton::clicked, receiver: modifier, |
546 | slot: &GraphModifier::selectBar); |
547 | QObject::connect(sender: swapAxisButton, signal: &QPushButton::clicked, receiver: modifier, |
548 | slot: &GraphModifier::swapAxis); |
549 | QObject::connect(sender: insertRemoveTestButton, signal: &QPushButton::clicked, receiver: modifier, |
550 | slot: &GraphModifier::insertRemoveTestToggle); |
551 | QObject::connect(sender: releaseAxesButton, signal: &QPushButton::clicked, receiver: modifier, |
552 | slot: &GraphModifier::releaseAxes); |
553 | QObject::connect(sender: releaseProxiesButton, signal: &QPushButton::clicked, receiver: modifier, |
554 | slot: &GraphModifier::releaseSeries); |
555 | |
556 | QObject::connect(sender: flipViewsButton, signal: &QPushButton::clicked, receiver: modifier, |
557 | slot: &GraphModifier::flipViews); |
558 | QObject::connect(sender: changeColorStyleButton, signal: &QPushButton::clicked, receiver: modifier, |
559 | slot: &GraphModifier::changeColorStyle); |
560 | QObject::connect(sender: ownThemeButton, signal: &QPushButton::clicked, receiver: modifier, |
561 | slot: &GraphModifier::useOwnTheme); |
562 | QObject::connect(sender: primarySeriesTestsButton, signal: &QPushButton::clicked, receiver: modifier, |
563 | slot: &GraphModifier::primarySeriesTest); |
564 | QObject::connect(sender: toggleRotationButton, signal: &QPushButton::clicked, receiver: modifier, |
565 | slot: &GraphModifier::toggleRotation); |
566 | QObject::connect(sender: logAxisButton, signal: &QPushButton::clicked, receiver: modifier, |
567 | slot: &GraphModifier::useLogAxis); |
568 | QObject::connect(sender: testItemAndRowChangesButton, signal: &QPushButton::clicked, receiver: modifier, |
569 | slot: &GraphModifier::testItemAndRowChanges); |
570 | QObject::connect(sender: colorDialog, signal: &QColorDialog::currentColorChanged, receiver: modifier, |
571 | slot: &GraphModifier::changeBaseColor); |
572 | QObject::connect(sender: gradientBtoYPB, signal: &QPushButton::clicked, receiver: modifier, |
573 | slot: &GraphModifier::setGradient); |
574 | |
575 | QObject::connect(sender: fontList, signal: &QFontComboBox::currentFontChanged, receiver: modifier, |
576 | slot: &GraphModifier::changeFont); |
577 | |
578 | QObject::connect(sender: fpsCheckBox, signal: &QCheckBox::stateChanged, receiver: modifier, |
579 | slot: &GraphModifier::setFpsMeasurement); |
580 | QObject::connect(sender: reverseValueAxisCheckBox, signal: &QCheckBox::stateChanged, receiver: modifier, |
581 | slot: &GraphModifier::reverseValueAxis); |
582 | QObject::connect(sender: backgroundCheckBox, signal: &QCheckBox::stateChanged, receiver: modifier, |
583 | slot: &GraphModifier::setBackgroundEnabled); |
584 | QObject::connect(sender: gridCheckBox, signal: &QCheckBox::stateChanged, receiver: modifier, |
585 | slot: &GraphModifier::setGridEnabled); |
586 | QObject::connect(sender: inputHandlerRotationCheckBox, signal: &QCheckBox::stateChanged, receiver: modifier, |
587 | slot: &GraphModifier::setInputHandlerRotationEnabled); |
588 | QObject::connect(sender: inputHandlerZoomCheckBox, signal: &QCheckBox::stateChanged, receiver: modifier, |
589 | slot: &GraphModifier::setInputHandlerZoomEnabled); |
590 | QObject::connect(sender: inputHandlerSelectionCheckBox, signal: &QCheckBox::stateChanged, receiver: modifier, |
591 | slot: &GraphModifier::setInputHandlerSelectionEnabled); |
592 | QObject::connect(sender: inputHandlerZoomAtTargetCheckBox, signal: &QCheckBox::stateChanged, receiver: modifier, |
593 | slot: &GraphModifier::setInputHandlerZoomAtTargetEnabled); |
594 | QObject::connect(sender: rotationCheckBox, signal: &QCheckBox::stateChanged, receiver: modifier, |
595 | slot: &GraphModifier::setUseNullInputHandler); |
596 | |
597 | QObject::connect(sender: rotationCheckBox, signal: &QCheckBox::stateChanged, receiver: rotationSliderX, |
598 | slot: &QSlider::setEnabled); |
599 | QObject::connect(sender: rotationCheckBox, signal: &QCheckBox::stateChanged, receiver: rotationSliderX, |
600 | slot: &QSlider::setValue); |
601 | QObject::connect(sender: rotationCheckBox, signal: &QCheckBox::stateChanged, receiver: rotationSliderY, |
602 | slot: &QSlider::setEnabled); |
603 | QObject::connect(sender: rotationCheckBox, signal: &QCheckBox::stateChanged, receiver: rotationSliderY, |
604 | slot: &QSlider::setValue); |
605 | |
606 | QObject::connect(sender: reflectionCheckBox, signal: &QCheckBox::stateChanged, receiver: modifier, |
607 | slot: &GraphModifier::setReflection); |
608 | QObject::connect(sender: reflectivitySlider, signal: &QSlider::valueChanged, receiver: modifier, |
609 | slot: &GraphModifier::setReflectivity); |
610 | QObject::connect(sender: floorLevelSlider, signal: &QSlider::valueChanged, receiver: modifier, |
611 | slot: &GraphModifier::setFloorLevel); |
612 | QObject::connect(sender: marginSlider, signal: &QSlider::valueChanged, receiver: modifier, |
613 | slot: &GraphModifier::setGraphMargin); |
614 | QObject::connect(sender: toggleCustomItemButton, signal: &QPushButton::clicked, receiver: modifier, |
615 | slot: &GraphModifier::toggleCustomItem); |
616 | |
617 | QObject::connect(sender: staticCheckBox, signal: &QCheckBox::stateChanged, receiver: addDataButton, |
618 | slot: &QPushButton::setEnabled); |
619 | QObject::connect(sender: staticCheckBox, signal: &QCheckBox::stateChanged, receiver: addMultiDataButton, |
620 | slot: &QPushButton::setEnabled); |
621 | QObject::connect(sender: staticCheckBox, signal: &QCheckBox::stateChanged, receiver: insertDataButton, |
622 | slot: &QPushButton::setEnabled); |
623 | QObject::connect(sender: staticCheckBox, signal: &QCheckBox::stateChanged, receiver: insertMultiDataButton, |
624 | slot: &QPushButton::setEnabled); |
625 | QObject::connect(sender: staticCheckBox, signal: &QCheckBox::stateChanged, receiver: changeSingleDataButton, |
626 | slot: &QPushButton::setEnabled); |
627 | QObject::connect(sender: staticCheckBox, signal: &QCheckBox::stateChanged, receiver: changeRowButton, |
628 | slot: &QPushButton::setEnabled); |
629 | QObject::connect(sender: staticCheckBox, signal: &QCheckBox::stateChanged, receiver: changeRowsButton, |
630 | slot: &QPushButton::setEnabled); |
631 | QObject::connect(sender: staticCheckBox, signal: &QCheckBox::stateChanged, receiver: removeRowButton, |
632 | slot: &QPushButton::setEnabled); |
633 | QObject::connect(sender: staticCheckBox, signal: &QCheckBox::stateChanged, receiver: removeRowsButton, |
634 | slot: &QPushButton::setEnabled); |
635 | QObject::connect(sender: staticCheckBox, signal: &QCheckBox::stateChanged, receiver: massiveArrayButton, |
636 | slot: &QPushButton::setEnabled); |
637 | QObject::connect(sender: staticCheckBox, signal: &QCheckBox::stateChanged, receiver: sampleSliderX, |
638 | slot: &QSlider::setEnabled); |
639 | QObject::connect(sender: staticCheckBox, signal: &QCheckBox::stateChanged, receiver: sampleSliderZ, |
640 | slot: &QSlider::setEnabled); |
641 | QObject::connect(sender: staticCheckBox, signal: &QCheckBox::stateChanged, receiver: minSliderX, |
642 | slot: &QSlider::setEnabled); |
643 | QObject::connect(sender: staticCheckBox, signal: &QCheckBox::stateChanged, receiver: minSliderZ, |
644 | slot: &QSlider::setEnabled); |
645 | QObject::connect(sender: staticCheckBox, signal: &QCheckBox::stateChanged, receiver: minSliderY, |
646 | slot: &QSlider::setEnabled); |
647 | QObject::connect(sender: staticCheckBox, signal: &QCheckBox::stateChanged, receiver: maxSliderY, |
648 | slot: &QSlider::setEnabled); |
649 | QObject::connect(sender: staticCheckBox, signal: &QCheckBox::stateChanged, receiver: swapAxisButton, |
650 | slot: &QSlider::setEnabled); |
651 | QObject::connect(sender: staticCheckBox, signal: &QCheckBox::stateChanged, receiver: modifier, slot: &GraphModifier::restart); |
652 | |
653 | modifier->setFpsLabel(fpsLabel); |
654 | |
655 | modifier->start(); |
656 | |
657 | return app.exec(); |
658 | } |
659 | |