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 "scatterchart.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 <QComboBox>
40#include <QFontComboBox>
41#include <QLabel>
42#include <QScreen>
43#include <QFontDatabase>
44#include <QLinearGradient>
45#include <QPainter>
46
47int main(int argc, char **argv)
48{
49 QApplication app(argc, argv);
50 //QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
51
52 QWidget *widget = new QWidget;
53 QHBoxLayout *hLayout = new QHBoxLayout(widget);
54 QVBoxLayout *vLayout = new QVBoxLayout();
55 QVBoxLayout *vLayout2 = new QVBoxLayout();
56 QVBoxLayout *vLayout3 = new QVBoxLayout();
57
58 Q3DScatter *chart = new Q3DScatter();
59 QSize screenSize = chart->screen()->size();
60
61 QWidget *container = QWidget::createWindowContainer(window: chart);
62 container->setMinimumSize(QSize(screenSize.width() / 2, screenSize.height() / 2));
63 container->setMaximumSize(screenSize);
64 container->setSizePolicy(hor: QSizePolicy::Expanding, ver: QSizePolicy::Expanding);
65 container->setFocusPolicy(Qt::StrongFocus);
66
67 widget->setWindowTitle(QStringLiteral("values of some things in something"));
68
69 hLayout->addWidget(container, stretch: 1);
70 hLayout->addLayout(layout: vLayout);
71 hLayout->addLayout(layout: vLayout2);
72 hLayout->addLayout(layout: vLayout3);
73
74 QPushButton *themeButton = new QPushButton(widget);
75 themeButton->setText(QStringLiteral("Change theme"));
76
77 QPushButton *labelButton = new QPushButton(widget);
78 labelButton->setText(QStringLiteral("Change label style"));
79
80 QPushButton *styleButton = new QPushButton(widget);
81 styleButton->setText(QStringLiteral("Change item style"));
82
83 QPushButton *cameraButton = new QPushButton(widget);
84 cameraButton->setText(QStringLiteral("Change camera preset"));
85
86 QPushButton *clearButton = new QPushButton(widget);
87 clearButton->setText(QStringLiteral("Clear chart"));
88
89 QPushButton *resetButton = new QPushButton(widget);
90 resetButton->setText(QStringLiteral("Reset axes"));
91
92 QPushButton *addOneButton = new QPushButton(widget);
93 addOneButton->setText(QStringLiteral("Add item"));
94
95 QPushButton *addBunchButton = new QPushButton(widget);
96 addBunchButton->setText(QStringLiteral("Add bunch of items"));
97
98 QPushButton *insertOneButton = new QPushButton(widget);
99 insertOneButton->setText(QStringLiteral("Insert item"));
100
101 QPushButton *insertBunchButton = new QPushButton(widget);
102 insertBunchButton->setText(QStringLiteral("Insert bunch of items"));
103
104 QPushButton *changeOneButton = new QPushButton(widget);
105 changeOneButton->setText(QStringLiteral("Change selected item"));
106
107 QPushButton *changeBunchButton = new QPushButton(widget);
108 changeBunchButton->setText(QStringLiteral("Change bunch of items"));
109
110 QPushButton *removeOneButton = new QPushButton(widget);
111 removeOneButton->setText(QStringLiteral("Remove selected item"));
112
113 QPushButton *removeBunchButton = new QPushButton(widget);
114 removeBunchButton->setText(QStringLiteral("Remove bunch of items"));
115
116 QPushButton *setSelectedItemButton = new QPushButton(widget);
117 setSelectedItemButton->setText(QStringLiteral("Select/deselect item 3"));
118
119 QPushButton *clearSeriesDataButton = new QPushButton(widget);
120 clearSeriesDataButton->setText(QStringLiteral("Clear series data"));
121
122 QPushButton *addSeriesButton = new QPushButton(widget);
123 addSeriesButton->setText(QStringLiteral("Add Series"));
124
125 QPushButton *removeSeriesButton = new QPushButton(widget);
126 removeSeriesButton->setText(QStringLiteral("Remove Series"));
127
128 QPushButton *toggleSeriesVisibilityButton = new QPushButton(widget);
129 toggleSeriesVisibilityButton->setText(QStringLiteral("Toggle visibility"));
130
131 QPushButton *changeSeriesNameButton = new QPushButton(widget);
132 changeSeriesNameButton->setText(QStringLiteral("Series name"));
133
134 QPushButton *startTimerButton = new QPushButton(widget);
135 startTimerButton->setText(QStringLiteral("Start/stop timer"));
136
137 QPushButton *massiveDataTestButton = new QPushButton(widget);
138 massiveDataTestButton->setText(QStringLiteral("Massive data test"));
139
140 QPushButton *testItemChangesButton = new QPushButton(widget);
141 testItemChangesButton->setText(QStringLiteral("Test Item changing"));
142
143 QPushButton *testReverseButton = new QPushButton(widget);
144 testReverseButton->setText(QStringLiteral("Test Axis Reversing"));
145
146 QPushButton *renderToImageButton = new QPushButton(widget);
147 renderToImageButton->setText(QStringLiteral("Render the graph to an image"));
148
149 QLinearGradient grBtoY(0, 0, 100, 0);
150 grBtoY.setColorAt(pos: 1.0, color: Qt::black);
151 grBtoY.setColorAt(pos: 0.67, color: Qt::blue);
152 grBtoY.setColorAt(pos: 0.33, color: Qt::red);
153 grBtoY.setColorAt(pos: 0.0, color: Qt::yellow);
154 QPixmap pm(100, 24);
155 QPainter pmp(&pm);
156 pmp.setBrush(QBrush(grBtoY));
157 pmp.setPen(Qt::NoPen);
158 pmp.drawRect(x: 0, y: 0, w: 100, h: 24);
159 QPushButton *gradientBtoYPB = new QPushButton(widget);
160 gradientBtoYPB->setIcon(QIcon(pm));
161 gradientBtoYPB->setIconSize(QSize(100, 24));
162
163 QLabel *fpsLabel = new QLabel(QStringLiteral(""));
164
165 QCheckBox *fpsCheckBox = new QCheckBox(widget);
166 fpsCheckBox->setText(QStringLiteral("Measure Fps"));
167 fpsCheckBox->setChecked(false);
168
169 QCheckBox *backgroundCheckBox = new QCheckBox(widget);
170 backgroundCheckBox->setText(QStringLiteral("Show background"));
171 backgroundCheckBox->setChecked(true);
172
173 QCheckBox *gridCheckBox = new QCheckBox(widget);
174 gridCheckBox->setText(QStringLiteral("Show grid"));
175 gridCheckBox->setChecked(true);
176
177 QComboBox *shadowQuality = new QComboBox(widget);
178 shadowQuality->addItem(QStringLiteral("None"));
179 shadowQuality->addItem(QStringLiteral("Low"));
180 shadowQuality->addItem(QStringLiteral("Medium"));
181 shadowQuality->addItem(QStringLiteral("High"));
182 shadowQuality->addItem(QStringLiteral("Low Soft"));
183 shadowQuality->addItem(QStringLiteral("Medium Soft"));
184 shadowQuality->addItem(QStringLiteral("High Soft"));
185 shadowQuality->setCurrentIndex(0);
186
187 QFontComboBox *fontList = new QFontComboBox(widget);
188
189 QSlider *fontSizeSlider = new QSlider(Qt::Horizontal, widget);
190 fontSizeSlider->setTickInterval(15);
191 fontSizeSlider->setTickPosition(QSlider::TicksBelow);
192 fontSizeSlider->setMinimum(1);
193 fontSizeSlider->setValue(30);
194 fontSizeSlider->setMaximum(200);
195
196 QSlider *pointSizeSlider = new QSlider(Qt::Horizontal, widget);
197 pointSizeSlider->setTickInterval(15);
198 pointSizeSlider->setTickPosition(QSlider::TicksBelow);
199 pointSizeSlider->setMinimum(1);
200 pointSizeSlider->setValue(30);
201 pointSizeSlider->setMaximum(100);
202
203 QSlider *minSliderX = new QSlider(Qt::Horizontal, widget);
204 minSliderX->setTickInterval(50);
205 minSliderX->setTickPosition(QSlider::TicksBelow);
206 minSliderX->setMinimum(-100);
207 minSliderX->setValue(-50);
208 minSliderX->setMaximum(100);
209
210 QSlider *minSliderY = new QSlider(Qt::Horizontal, widget);
211 minSliderY->setTickInterval(100);
212 minSliderY->setTickPosition(QSlider::TicksBelow);
213 minSliderY->setMinimum(-200);
214 minSliderY->setValue(-100);
215 minSliderY->setMaximum(200);
216
217 QSlider *minSliderZ = new QSlider(Qt::Horizontal, widget);
218 minSliderZ->setTickInterval(50);
219 minSliderZ->setTickPosition(QSlider::TicksBelow);
220 minSliderZ->setMinimum(-100);
221 minSliderZ->setValue(-50);
222 minSliderZ->setMaximum(100);
223
224 QSlider *maxSliderX = new QSlider(Qt::Horizontal, widget);
225 maxSliderX->setTickInterval(50);
226 maxSliderX->setTickPosition(QSlider::TicksAbove);
227 maxSliderX->setMinimum(-100);
228 maxSliderX->setValue(50);
229 maxSliderX->setMaximum(100);
230
231 QSlider *maxSliderY = new QSlider(Qt::Horizontal, widget);
232 maxSliderY->setTickInterval(100);
233 maxSliderY->setTickPosition(QSlider::TicksAbove);
234 maxSliderY->setMinimum(-200);
235 maxSliderY->setValue(120);
236 maxSliderY->setMaximum(200);
237
238 QSlider *maxSliderZ = new QSlider(Qt::Horizontal, widget);
239 maxSliderZ->setTickInterval(50);
240 maxSliderZ->setTickPosition(QSlider::TicksAbove);
241 maxSliderZ->setMinimum(-100);
242 maxSliderZ->setValue(50);
243 maxSliderZ->setMaximum(100);
244
245 QSlider *aspectRatioSlider = new QSlider(Qt::Horizontal, widget);
246 aspectRatioSlider->setTickInterval(10);
247 aspectRatioSlider->setTickPosition(QSlider::TicksBelow);
248 aspectRatioSlider->setMinimum(1);
249 aspectRatioSlider->setValue(20);
250 aspectRatioSlider->setMaximum(100);
251
252 QSlider *horizontalAspectRatioSlider = new QSlider(Qt::Horizontal, widget);
253 horizontalAspectRatioSlider->setTickInterval(30);
254 horizontalAspectRatioSlider->setTickPosition(QSlider::TicksBelow);
255 horizontalAspectRatioSlider->setMinimum(0);
256 horizontalAspectRatioSlider->setValue(0);
257 horizontalAspectRatioSlider->setMaximum(300);
258
259 QCheckBox *optimizationStaticCB = new QCheckBox(widget);
260 optimizationStaticCB->setText(QStringLiteral("Static optimization"));
261 optimizationStaticCB->setChecked(false);
262
263 QCheckBox *orthoCB = new QCheckBox(widget);
264 orthoCB->setText(QStringLiteral("Orthographic projection"));
265 orthoCB->setChecked(false);
266
267 QCheckBox *polarCB = new QCheckBox(widget);
268 polarCB->setText(QStringLiteral("Polar graph"));
269 polarCB->setChecked(false);
270
271 QCheckBox *axisTitlesVisibleCB = new QCheckBox(widget);
272 axisTitlesVisibleCB->setText(QStringLiteral("Axis titles visible"));
273 axisTitlesVisibleCB->setChecked(false);
274
275 QCheckBox *axisTitlesFixedCB = new QCheckBox(widget);
276 axisTitlesFixedCB->setText(QStringLiteral("Axis titles fixed"));
277 axisTitlesFixedCB->setChecked(true);
278
279 QSlider *axisLabelRotationSlider = new QSlider(Qt::Horizontal, widget);
280 axisLabelRotationSlider->setTickInterval(10);
281 axisLabelRotationSlider->setTickPosition(QSlider::TicksBelow);
282 axisLabelRotationSlider->setMinimum(0);
283 axisLabelRotationSlider->setValue(0);
284 axisLabelRotationSlider->setMaximum(90);
285
286 QSlider *radialLabelSlider = new QSlider(Qt::Horizontal, widget);
287 radialLabelSlider->setTickInterval(10);
288 radialLabelSlider->setTickPosition(QSlider::TicksBelow);
289 radialLabelSlider->setMinimum(0);
290 radialLabelSlider->setValue(100);
291 radialLabelSlider->setMaximum(150);
292
293 QSlider *cameraTargetSliderX = new QSlider(Qt::Horizontal, widget);
294 cameraTargetSliderX->setTickInterval(1);
295 cameraTargetSliderX->setMinimum(-100);
296 cameraTargetSliderX->setValue(0);
297 cameraTargetSliderX->setMaximum(100);
298 QSlider *cameraTargetSliderY = new QSlider(Qt::Horizontal, widget);
299 cameraTargetSliderY->setTickInterval(1);
300 cameraTargetSliderY->setMinimum(-100);
301 cameraTargetSliderY->setValue(0);
302 cameraTargetSliderY->setMaximum(100);
303 QSlider *cameraTargetSliderZ = new QSlider(Qt::Horizontal, widget);
304 cameraTargetSliderZ->setTickInterval(1);
305 cameraTargetSliderZ->setMinimum(-100);
306 cameraTargetSliderZ->setValue(0);
307 cameraTargetSliderZ->setMaximum(100);
308
309 QSlider *marginSlider = new QSlider(Qt::Horizontal, widget);
310 marginSlider->setMinimum(-1);
311 marginSlider->setValue(-1);
312 marginSlider->setMaximum(100);
313
314 vLayout->addWidget(themeButton, stretch: 0, alignment: Qt::AlignTop);
315 vLayout->addWidget(labelButton, stretch: 0, alignment: Qt::AlignTop);
316 vLayout->addWidget(styleButton, stretch: 0, alignment: Qt::AlignTop);
317 vLayout->addWidget(cameraButton, stretch: 0, alignment: Qt::AlignTop);
318 vLayout->addWidget(clearButton, stretch: 0, alignment: Qt::AlignTop);
319 vLayout->addWidget(resetButton, stretch: 0, alignment: Qt::AlignTop);
320 vLayout->addWidget(addOneButton, stretch: 0, alignment: Qt::AlignTop);
321 vLayout->addWidget(addBunchButton, stretch: 0, alignment: Qt::AlignTop);
322 vLayout->addWidget(insertOneButton, stretch: 0, alignment: Qt::AlignTop);
323 vLayout->addWidget(insertBunchButton, stretch: 0, alignment: Qt::AlignTop);
324 vLayout->addWidget(changeOneButton, stretch: 0, alignment: Qt::AlignTop);
325 vLayout->addWidget(changeBunchButton, stretch: 0, alignment: Qt::AlignTop);
326 vLayout->addWidget(removeOneButton, stretch: 0, alignment: Qt::AlignTop);
327 vLayout->addWidget(removeBunchButton, stretch: 0, alignment: Qt::AlignTop);
328 vLayout->addWidget(setSelectedItemButton, stretch: 0, alignment: Qt::AlignTop);
329 vLayout->addWidget(clearSeriesDataButton, stretch: 0, alignment: Qt::AlignTop);
330 vLayout->addWidget(addSeriesButton, stretch: 0, alignment: Qt::AlignTop);
331 vLayout->addWidget(removeSeriesButton, stretch: 0, alignment: Qt::AlignTop);
332 vLayout->addWidget(toggleSeriesVisibilityButton, stretch: 0, alignment: Qt::AlignTop);
333 vLayout->addWidget(changeSeriesNameButton, stretch: 0, alignment: Qt::AlignTop);
334 vLayout->addWidget(startTimerButton, stretch: 0, alignment: Qt::AlignTop);
335 vLayout->addWidget(massiveDataTestButton, stretch: 0, alignment: Qt::AlignTop);
336 vLayout->addWidget(testItemChangesButton, stretch: 0, alignment: Qt::AlignTop);
337 vLayout->addWidget(testReverseButton, stretch: 0, alignment: Qt::AlignTop);
338 vLayout->addWidget(renderToImageButton, stretch: 1, alignment: Qt::AlignTop);
339
340 vLayout2->addWidget(gradientBtoYPB, stretch: 0, alignment: Qt::AlignTop);
341 vLayout2->addWidget(fpsLabel, stretch: 0, alignment: Qt::AlignTop);
342 vLayout2->addWidget(fpsCheckBox, stretch: 0, alignment: Qt::AlignTop);
343 vLayout2->addWidget(backgroundCheckBox);
344 vLayout2->addWidget(gridCheckBox);
345 vLayout2->addWidget(new QLabel(QStringLiteral("Adjust shadow quality")));
346 vLayout2->addWidget(shadowQuality, stretch: 0, alignment: Qt::AlignTop);
347 vLayout2->addWidget(new QLabel(QStringLiteral("Adjust point size")));
348 vLayout2->addWidget(pointSizeSlider, stretch: 0, alignment: Qt::AlignTop);
349 vLayout2->addWidget(new QLabel(QStringLiteral("Adjust data window")));
350 vLayout2->addWidget(minSliderX, stretch: 0, alignment: Qt::AlignTop);
351 vLayout2->addWidget(maxSliderX, stretch: 0, alignment: Qt::AlignTop);
352 vLayout2->addWidget(minSliderY, stretch: 0, alignment: Qt::AlignTop);
353 vLayout2->addWidget(maxSliderY, stretch: 0, alignment: Qt::AlignTop);
354 vLayout2->addWidget(minSliderZ, stretch: 0, alignment: Qt::AlignTop);
355 vLayout2->addWidget(maxSliderZ, stretch: 0, alignment: Qt::AlignTop);
356 vLayout2->addWidget(new QLabel(QStringLiteral("Change font")));
357 vLayout2->addWidget(fontList);
358 vLayout2->addWidget(new QLabel(QStringLiteral("Adjust font size")));
359 vLayout2->addWidget(fontSizeSlider);
360 vLayout2->addWidget(new QLabel(QStringLiteral("Adjust vertical aspect ratio")));
361 vLayout2->addWidget(aspectRatioSlider);
362 vLayout2->addWidget(new QLabel(QStringLiteral("Adjust horizontal aspect ratio")));
363 vLayout2->addWidget(horizontalAspectRatioSlider, stretch: 1, alignment: Qt::AlignTop);
364
365 vLayout3->addWidget(optimizationStaticCB);
366 vLayout3->addWidget(orthoCB);
367 vLayout3->addWidget(polarCB);
368 vLayout3->addWidget(axisTitlesVisibleCB);
369 vLayout3->addWidget(axisTitlesFixedCB);
370 vLayout3->addWidget(new QLabel(QStringLiteral("Axis label rotation")));
371 vLayout3->addWidget(axisLabelRotationSlider);
372 vLayout3->addWidget(new QLabel(QStringLiteral("Radial label offset")));
373 vLayout3->addWidget(radialLabelSlider, stretch: 0, alignment: Qt::AlignTop);
374 vLayout3->addWidget(new QLabel(QStringLiteral("Camera target")), stretch: 0, alignment: Qt::AlignTop);
375 vLayout3->addWidget(cameraTargetSliderX, stretch: 0, alignment: Qt::AlignTop);
376 vLayout3->addWidget(cameraTargetSliderY, stretch: 0, alignment: Qt::AlignTop);
377 vLayout3->addWidget(cameraTargetSliderZ, stretch: 0, alignment: Qt::AlignTop);
378 vLayout3->addWidget(new QLabel(QStringLiteral("Adjust margin")), stretch: 0, alignment: Qt::AlignTop);
379 vLayout3->addWidget(marginSlider, stretch: 1, alignment: Qt::AlignTop);
380
381 ScatterDataModifier *modifier = new ScatterDataModifier(chart);
382
383 QObject::connect(sender: fontSizeSlider, signal: &QSlider::valueChanged, receiver: modifier,
384 slot: &ScatterDataModifier::changeFontSize);
385 QObject::connect(sender: pointSizeSlider, signal: &QSlider::valueChanged, receiver: modifier,
386 slot: &ScatterDataModifier::changePointSize);
387
388 QObject::connect(sender: styleButton, signal: &QPushButton::clicked, receiver: modifier,
389 slot: &ScatterDataModifier::changeStyle);
390 QObject::connect(sender: cameraButton, signal: &QPushButton::clicked, receiver: modifier,
391 slot: &ScatterDataModifier::changePresetCamera);
392 QObject::connect(sender: clearButton, signal: &QPushButton::clicked, receiver: modifier,
393 slot: &ScatterDataModifier::clear);
394 QObject::connect(sender: resetButton, signal: &QPushButton::clicked, receiver: modifier,
395 slot: &ScatterDataModifier::resetAxes);
396 QObject::connect(sender: addOneButton, signal: &QPushButton::clicked, receiver: modifier,
397 slot: &ScatterDataModifier::addOne);
398 QObject::connect(sender: addBunchButton, signal: &QPushButton::clicked, receiver: modifier,
399 slot: &ScatterDataModifier::addBunch);
400 QObject::connect(sender: insertOneButton, signal: &QPushButton::clicked, receiver: modifier,
401 slot: &ScatterDataModifier::insertOne);
402 QObject::connect(sender: insertBunchButton, signal: &QPushButton::clicked, receiver: modifier,
403 slot: &ScatterDataModifier::insertBunch);
404 QObject::connect(sender: changeOneButton, signal: &QPushButton::clicked, receiver: modifier,
405 slot: &ScatterDataModifier::changeOne);
406 QObject::connect(sender: changeBunchButton, signal: &QPushButton::clicked, receiver: modifier,
407 slot: &ScatterDataModifier::changeBunch);
408 QObject::connect(sender: removeOneButton, signal: &QPushButton::clicked, receiver: modifier,
409 slot: &ScatterDataModifier::removeOne);
410 QObject::connect(sender: removeBunchButton, signal: &QPushButton::clicked, receiver: modifier,
411 slot: &ScatterDataModifier::removeBunch);
412 QObject::connect(sender: setSelectedItemButton, signal: &QPushButton::clicked, receiver: modifier,
413 slot: &ScatterDataModifier::selectItem);
414 QObject::connect(sender: clearSeriesDataButton, signal: &QPushButton::clicked, receiver: modifier,
415 slot: &ScatterDataModifier::clearSeriesData);
416 QObject::connect(sender: addSeriesButton, signal: &QPushButton::clicked, receiver: modifier,
417 slot: &ScatterDataModifier::addSeries);
418 QObject::connect(sender: removeSeriesButton, signal: &QPushButton::clicked, receiver: modifier,
419 slot: &ScatterDataModifier::removeSeries);
420 QObject::connect(sender: toggleSeriesVisibilityButton, signal: &QPushButton::clicked, receiver: modifier,
421 slot: &ScatterDataModifier::toggleSeriesVisibility);
422 QObject::connect(sender: changeSeriesNameButton, signal: &QPushButton::clicked, receiver: modifier,
423 slot: &ScatterDataModifier::changeSeriesName);
424 QObject::connect(sender: startTimerButton, signal: &QPushButton::clicked, receiver: modifier,
425 slot: &ScatterDataModifier::startStopTimer);
426 QObject::connect(sender: massiveDataTestButton, signal: &QPushButton::clicked, receiver: modifier,
427 slot: &ScatterDataModifier::massiveDataTest);
428 QObject::connect(sender: testItemChangesButton, signal: &QPushButton::clicked, receiver: modifier,
429 slot: &ScatterDataModifier::testItemChanges);
430 QObject::connect(sender: testReverseButton, signal: &QPushButton::clicked, receiver: modifier,
431 slot: &ScatterDataModifier::testAxisReverse);
432 QObject::connect(sender: renderToImageButton, signal: &QPushButton::clicked, receiver: modifier,
433 slot: &ScatterDataModifier::renderToImage);
434 QObject::connect(sender: gradientBtoYPB, signal: &QPushButton::clicked, receiver: modifier,
435 slot: &ScatterDataModifier::setGradient);
436 QObject::connect(sender: themeButton, signal: &QPushButton::clicked, receiver: modifier,
437 slot: &ScatterDataModifier::changeTheme);
438 QObject::connect(sender: labelButton, signal: &QPushButton::clicked, receiver: modifier,
439 slot: &ScatterDataModifier::changeLabelStyle);
440
441 QObject::connect(sender: shadowQuality, SIGNAL(currentIndexChanged(int)), receiver: modifier,
442 SLOT(changeShadowQuality(int)));
443 QObject::connect(sender: modifier, signal: &ScatterDataModifier::shadowQualityChanged, receiver: shadowQuality,
444 slot: &QComboBox::setCurrentIndex);
445 QObject::connect(sender: fontList, signal: &QFontComboBox::currentFontChanged, receiver: modifier,
446 slot: &ScatterDataModifier::changeFont);
447
448 QObject::connect(sender: fpsCheckBox, signal: &QCheckBox::stateChanged, receiver: modifier,
449 slot: &ScatterDataModifier::setFpsMeasurement);
450 QObject::connect(sender: backgroundCheckBox, signal: &QCheckBox::stateChanged, receiver: modifier,
451 slot: &ScatterDataModifier::setBackgroundEnabled);
452 QObject::connect(sender: gridCheckBox, signal: &QCheckBox::stateChanged, receiver: modifier,
453 slot: &ScatterDataModifier::setGridEnabled);
454
455 QObject::connect(sender: minSliderX, signal: &QSlider::valueChanged, receiver: modifier,
456 slot: &ScatterDataModifier::setMinX);
457 QObject::connect(sender: minSliderY, signal: &QSlider::valueChanged, receiver: modifier,
458 slot: &ScatterDataModifier::setMinY);
459 QObject::connect(sender: minSliderZ, signal: &QSlider::valueChanged, receiver: modifier,
460 slot: &ScatterDataModifier::setMinZ);
461 QObject::connect(sender: maxSliderX, signal: &QSlider::valueChanged, receiver: modifier,
462 slot: &ScatterDataModifier::setMaxX);
463 QObject::connect(sender: maxSliderY, signal: &QSlider::valueChanged, receiver: modifier,
464 slot: &ScatterDataModifier::setMaxY);
465 QObject::connect(sender: maxSliderZ, signal: &QSlider::valueChanged, receiver: modifier,
466 slot: &ScatterDataModifier::setMaxZ);
467 QObject::connect(sender: optimizationStaticCB, signal: &QCheckBox::stateChanged, receiver: modifier,
468 slot: &ScatterDataModifier::toggleStatic);
469 QObject::connect(sender: orthoCB, signal: &QCheckBox::stateChanged, receiver: modifier,
470 slot: &ScatterDataModifier::toggleOrtho);
471 QObject::connect(sender: polarCB, signal: &QCheckBox::stateChanged, receiver: modifier,
472 slot: &ScatterDataModifier::togglePolar);
473 QObject::connect(sender: axisTitlesVisibleCB, signal: &QCheckBox::stateChanged, receiver: modifier,
474 slot: &ScatterDataModifier::toggleAxisTitleVisibility);
475 QObject::connect(sender: axisTitlesFixedCB, signal: &QCheckBox::stateChanged, receiver: modifier,
476 slot: &ScatterDataModifier::toggleAxisTitleFixed);
477 QObject::connect(sender: axisLabelRotationSlider, signal: &QSlider::valueChanged, receiver: modifier,
478 slot: &ScatterDataModifier::changeLabelRotation);
479 QObject::connect(sender: aspectRatioSlider, signal: &QSlider::valueChanged, receiver: modifier,
480 slot: &ScatterDataModifier::setAspectRatio);
481 QObject::connect(sender: horizontalAspectRatioSlider, signal: &QSlider::valueChanged, receiver: modifier,
482 slot: &ScatterDataModifier::setHorizontalAspectRatio);
483 QObject::connect(sender: radialLabelSlider, signal: &QSlider::valueChanged, receiver: modifier,
484 slot: &ScatterDataModifier::changeRadialLabelOffset);
485 QObject::connect(sender: cameraTargetSliderX, signal: &QSlider::valueChanged, receiver: modifier,
486 slot: &ScatterDataModifier::setCameraTargetX);
487 QObject::connect(sender: cameraTargetSliderY, signal: &QSlider::valueChanged, receiver: modifier,
488 slot: &ScatterDataModifier::setCameraTargetY);
489 QObject::connect(sender: cameraTargetSliderZ, signal: &QSlider::valueChanged, receiver: modifier,
490 slot: &ScatterDataModifier::setCameraTargetZ);
491 QObject::connect(sender: marginSlider, signal: &QSlider::valueChanged, receiver: modifier,
492 slot: &ScatterDataModifier::setGraphMargin);
493
494 modifier->setFpsLabel(fpsLabel);
495
496 chart->setGeometry(QRect(0, 0, 800, 800));
497
498 modifier->start();
499 //modifier->renderToImage(); // Initial hidden render
500
501 widget->show();
502
503 return app.exec();
504}
505

source code of qtdatavis3d/tests/manual/scattertest/main.cpp