2023-03-02 13:45:23 +00:00
|
|
|
// Copyright (C) 2023 The Qt Company Ltd.
|
2023-05-09 07:38:04 +00:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2023-03-02 13:45:23 +00:00
|
|
|
|
|
|
|
#include "bargraph.h"
|
|
|
|
|
2023-10-12 06:37:46 +00:00
|
|
|
#include <QtGui/qfontdatabase.h>
|
2023-03-02 13:45:23 +00:00
|
|
|
#include <QtWidgets/qboxlayout.h>
|
2023-10-12 06:37:46 +00:00
|
|
|
#include <QtWidgets/qbuttongroup.h>
|
2023-03-02 13:45:23 +00:00
|
|
|
#include <QtWidgets/qcheckbox.h>
|
|
|
|
#include <QtWidgets/qfontcombobox.h>
|
|
|
|
#include <QtWidgets/qlabel.h>
|
2023-10-12 06:37:46 +00:00
|
|
|
#include <QtWidgets/qpushbutton.h>
|
2023-03-02 13:45:23 +00:00
|
|
|
#include <QtWidgets/qradiobutton.h>
|
2023-10-12 06:37:46 +00:00
|
|
|
#include <QtWidgets/qslider.h>
|
2023-03-02 13:45:23 +00:00
|
|
|
|
|
|
|
using namespace Qt::StringLiterals;
|
|
|
|
|
|
|
|
BarGraph::BarGraph()
|
|
|
|
{
|
|
|
|
//! [0]
|
|
|
|
m_barsGraph = new Q3DBars();
|
|
|
|
//! [0]
|
|
|
|
initialize();
|
|
|
|
}
|
|
|
|
|
|
|
|
void BarGraph::initialize()
|
|
|
|
{
|
|
|
|
//! [1]
|
|
|
|
m_barsWidget = new QWidget;
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *hLayout = new QHBoxLayout(m_barsWidget);
|
2023-03-02 13:45:23 +00:00
|
|
|
QSize screenSize = m_barsGraph->screen()->size();
|
|
|
|
m_barsGraph->setMinimumSize(QSize(screenSize.width() / 2, screenSize.height() / 1.75));
|
|
|
|
m_barsGraph->setMaximumSize(screenSize);
|
|
|
|
m_barsGraph->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
|
|
m_barsGraph->setFocusPolicy(Qt::StrongFocus);
|
|
|
|
hLayout->addWidget(m_barsGraph, 1);
|
|
|
|
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *vLayout = new QVBoxLayout();
|
2023-03-02 13:45:23 +00:00
|
|
|
hLayout->addLayout(vLayout);
|
|
|
|
//! [1]
|
|
|
|
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *themeList = new QComboBox(m_barsWidget);
|
2024-04-16 13:40:26 +00:00
|
|
|
themeList->addItem(u"QtGreen"_s);
|
|
|
|
themeList->addItem(u"QtGreenNeon"_s);
|
|
|
|
themeList->addItem(u"MixSeries"_s);
|
|
|
|
themeList->addItem(u"OrangeSeries"_s);
|
|
|
|
themeList->addItem(u"YellowSeries"_s);
|
|
|
|
themeList->addItem(u"BlueSeries"_s);
|
|
|
|
themeList->addItem(u"PurpleSeries"_s);
|
|
|
|
themeList->addItem(u"GreySeries"_s);
|
2023-03-02 13:45:23 +00:00
|
|
|
themeList->setCurrentIndex(0);
|
|
|
|
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *labelButton = new QPushButton(m_barsWidget);
|
2023-03-02 13:45:23 +00:00
|
|
|
labelButton->setText(u"Change label style"_s);
|
|
|
|
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *smoothCheckBox = new QCheckBox(m_barsWidget);
|
2023-03-02 13:45:23 +00:00
|
|
|
smoothCheckBox->setText(u"Smooth bars"_s);
|
|
|
|
smoothCheckBox->setChecked(false);
|
|
|
|
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *barStyleList = new QComboBox(m_barsWidget);
|
2023-09-04 08:08:03 +00:00
|
|
|
const QMetaObject &metaObj = QAbstract3DSeries::staticMetaObject;
|
|
|
|
int index = metaObj.indexOfEnumerator("Mesh");
|
|
|
|
QMetaEnum metaEnum = metaObj.enumerator(index);
|
|
|
|
barStyleList->addItem(u"Bar"_s, metaEnum.value(static_cast<int>(QAbstract3DSeries::Mesh::Bar)));
|
2023-10-12 06:37:46 +00:00
|
|
|
barStyleList->addItem(u"Pyramid"_s,
|
|
|
|
metaEnum.value(static_cast<int>(QAbstract3DSeries::Mesh::Pyramid)));
|
|
|
|
barStyleList->addItem(u"Cone"_s,
|
|
|
|
metaEnum.value(static_cast<int>(QAbstract3DSeries::Mesh::Cone)));
|
|
|
|
barStyleList->addItem(u"Cylinder"_s,
|
|
|
|
metaEnum.value(static_cast<int>(QAbstract3DSeries::Mesh::Cylinder)));
|
|
|
|
barStyleList->addItem(u"Bevel bar"_s,
|
|
|
|
metaEnum.value(static_cast<int>(QAbstract3DSeries::Mesh::BevelBar)));
|
|
|
|
barStyleList->addItem(u"Sphere"_s,
|
|
|
|
metaEnum.value(static_cast<int>(QAbstract3DSeries::Mesh::Sphere)));
|
|
|
|
barStyleList->addItem(u"UserDefined"_s,
|
|
|
|
metaEnum.value(static_cast<int>(QAbstract3DSeries::Mesh::UserDefined)));
|
2023-03-02 13:45:23 +00:00
|
|
|
barStyleList->setCurrentIndex(4);
|
|
|
|
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *cameraButton = new QPushButton(m_barsWidget);
|
2023-03-02 13:45:23 +00:00
|
|
|
cameraButton->setText(u"Change camera preset"_s);
|
|
|
|
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *zoomToSelectedButton = new QPushButton(m_barsWidget);
|
2023-03-02 13:45:23 +00:00
|
|
|
zoomToSelectedButton->setText(u"Zoom to selected bar"_s);
|
|
|
|
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *selectionModeList = new QComboBox(m_barsWidget);
|
2024-05-17 11:03:37 +00:00
|
|
|
selectionModeList->addItem(u"None"_s, int(QGraphs3D::SelectionNone));
|
|
|
|
selectionModeList->addItem(u"Bar"_s, int(QGraphs3D::SelectionItem));
|
|
|
|
selectionModeList->addItem(u"Row"_s, int(QGraphs3D::SelectionRow));
|
|
|
|
selectionModeList->addItem(u"Bar and Row"_s, int(QGraphs3D::SelectionItemAndRow));
|
|
|
|
selectionModeList->addItem(u"Column"_s, int(QGraphs3D::SelectionColumn));
|
|
|
|
selectionModeList->addItem(u"Bar and Column"_s, int(QGraphs3D::SelectionItemAndColumn));
|
|
|
|
selectionModeList->addItem(u"Row and Column"_s, int(QGraphs3D::SelectionRowAndColumn));
|
2023-03-02 13:45:23 +00:00
|
|
|
selectionModeList->addItem(u"Bar, Row and Column"_s,
|
2024-05-17 11:03:37 +00:00
|
|
|
int(QGraphs3D::SelectionItemRowAndColumn));
|
2023-03-02 13:45:23 +00:00
|
|
|
selectionModeList->addItem(u"Slice into Row"_s,
|
2024-05-17 11:03:37 +00:00
|
|
|
int(QGraphs3D::SelectionSlice
|
|
|
|
| QGraphs3D::SelectionRow));
|
2023-03-02 13:45:23 +00:00
|
|
|
selectionModeList->addItem(u"Slice into Row and Item"_s,
|
2024-05-17 11:03:37 +00:00
|
|
|
int(QGraphs3D::SelectionSlice
|
|
|
|
| QGraphs3D::SelectionItemAndRow));
|
2023-03-02 13:45:23 +00:00
|
|
|
selectionModeList->addItem(u"Slice into Column"_s,
|
2024-05-17 11:03:37 +00:00
|
|
|
int(QGraphs3D::SelectionSlice
|
|
|
|
| QGraphs3D::SelectionColumn));
|
2023-03-02 13:45:23 +00:00
|
|
|
selectionModeList->addItem(u"Slice into Column and Item"_s,
|
2024-05-17 11:03:37 +00:00
|
|
|
int(QGraphs3D::SelectionSlice
|
|
|
|
| QGraphs3D::SelectionItemAndColumn));
|
2023-03-02 13:45:23 +00:00
|
|
|
selectionModeList->addItem(u"Multi: Bar, Row, Col"_s,
|
2024-05-17 11:03:37 +00:00
|
|
|
int(QGraphs3D::SelectionItemRowAndColumn
|
|
|
|
| QGraphs3D::SelectionMultiSeries));
|
2023-03-02 13:45:23 +00:00
|
|
|
selectionModeList->addItem(u"Multi, Slice: Row, Item"_s,
|
2024-05-17 11:03:37 +00:00
|
|
|
int(QGraphs3D::SelectionSlice
|
|
|
|
| QGraphs3D::SelectionItemAndRow
|
|
|
|
| QGraphs3D::SelectionMultiSeries));
|
2023-03-02 13:45:23 +00:00
|
|
|
selectionModeList->addItem(u"Multi, Slice: Col, Item"_s,
|
2024-05-17 11:03:37 +00:00
|
|
|
int(QGraphs3D::SelectionSlice
|
|
|
|
| QGraphs3D::SelectionItemAndColumn
|
|
|
|
| QGraphs3D::SelectionMultiSeries));
|
2023-03-02 13:45:23 +00:00
|
|
|
selectionModeList->setCurrentIndex(1);
|
|
|
|
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *backgroundCheckBox = new QCheckBox(m_barsWidget);
|
2024-05-13 09:39:59 +00:00
|
|
|
backgroundCheckBox->setText(u"Show graph background"_s);
|
2023-03-02 13:45:23 +00:00
|
|
|
backgroundCheckBox->setChecked(false);
|
|
|
|
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *gridCheckBox = new QCheckBox(m_barsWidget);
|
2023-03-02 13:45:23 +00:00
|
|
|
gridCheckBox->setText(u"Show grid"_s);
|
|
|
|
gridCheckBox->setChecked(true);
|
|
|
|
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *seriesCheckBox = new QCheckBox(m_barsWidget);
|
2023-03-02 13:45:23 +00:00
|
|
|
seriesCheckBox->setText(u"Show second series"_s);
|
|
|
|
seriesCheckBox->setChecked(false);
|
|
|
|
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *reverseValueAxisCheckBox = new QCheckBox(m_barsWidget);
|
2023-03-02 13:45:23 +00:00
|
|
|
reverseValueAxisCheckBox->setText(u"Reverse value axis"_s);
|
|
|
|
reverseValueAxisCheckBox->setChecked(false);
|
|
|
|
|
|
|
|
//! [3]
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *rotationSliderX = new QSlider(Qt::Horizontal, m_barsWidget);
|
2023-03-02 13:45:23 +00:00
|
|
|
rotationSliderX->setTickInterval(30);
|
|
|
|
rotationSliderX->setTickPosition(QSlider::TicksBelow);
|
|
|
|
rotationSliderX->setMinimum(-180);
|
|
|
|
rotationSliderX->setValue(0);
|
|
|
|
rotationSliderX->setMaximum(180);
|
|
|
|
//! [3]
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *rotationSliderY = new QSlider(Qt::Horizontal, m_barsWidget);
|
2023-03-02 13:45:23 +00:00
|
|
|
rotationSliderY->setTickInterval(15);
|
|
|
|
rotationSliderY->setTickPosition(QSlider::TicksAbove);
|
|
|
|
rotationSliderY->setMinimum(-90);
|
|
|
|
rotationSliderY->setValue(0);
|
|
|
|
rotationSliderY->setMaximum(90);
|
|
|
|
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *fontSizeSlider = new QSlider(Qt::Horizontal, m_barsWidget);
|
2023-03-02 13:45:23 +00:00
|
|
|
fontSizeSlider->setTickInterval(10);
|
|
|
|
fontSizeSlider->setTickPosition(QSlider::TicksBelow);
|
|
|
|
fontSizeSlider->setMinimum(1);
|
|
|
|
fontSizeSlider->setValue(30);
|
|
|
|
fontSizeSlider->setMaximum(100);
|
|
|
|
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *fontList = new QFontComboBox(m_barsWidget);
|
2023-03-02 13:45:23 +00:00
|
|
|
fontList->setCurrentFont(QFont("Times New Roman"));
|
|
|
|
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *shadowQuality = new QComboBox(m_barsWidget);
|
2023-03-02 13:45:23 +00:00
|
|
|
shadowQuality->addItem(u"None"_s);
|
|
|
|
shadowQuality->addItem(u"Low"_s);
|
|
|
|
shadowQuality->addItem(u"Medium"_s);
|
|
|
|
shadowQuality->addItem(u"High"_s);
|
|
|
|
shadowQuality->addItem(u"Low Soft"_s);
|
|
|
|
shadowQuality->addItem(u"Medium Soft"_s);
|
|
|
|
shadowQuality->addItem(u"High Soft"_s);
|
|
|
|
shadowQuality->setCurrentIndex(5);
|
|
|
|
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *rangeList = new QComboBox(m_barsWidget);
|
2023-03-02 13:45:23 +00:00
|
|
|
rangeList->addItem(u"2015"_s);
|
|
|
|
rangeList->addItem(u"2016"_s);
|
|
|
|
rangeList->addItem(u"2017"_s);
|
|
|
|
rangeList->addItem(u"2018"_s);
|
|
|
|
rangeList->addItem(u"2019"_s);
|
|
|
|
rangeList->addItem(u"2020"_s);
|
|
|
|
rangeList->addItem(u"2021"_s);
|
|
|
|
rangeList->addItem(u"2022"_s);
|
|
|
|
rangeList->addItem(u"All"_s);
|
|
|
|
rangeList->setCurrentIndex(8);
|
|
|
|
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *axisTitlesVisibleCB = new QCheckBox(m_barsWidget);
|
2023-03-02 13:45:23 +00:00
|
|
|
axisTitlesVisibleCB->setText(u"Axis titles visible"_s);
|
|
|
|
axisTitlesVisibleCB->setChecked(true);
|
|
|
|
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *axisTitlesFixedCB = new QCheckBox(m_barsWidget);
|
2023-03-02 13:45:23 +00:00
|
|
|
axisTitlesFixedCB->setText(u"Axis titles fixed"_s);
|
|
|
|
axisTitlesFixedCB->setChecked(true);
|
|
|
|
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *axisLabelRotationSlider = new QSlider(Qt::Horizontal, m_barsWidget);
|
2023-03-02 13:45:23 +00:00
|
|
|
axisLabelRotationSlider->setTickInterval(10);
|
|
|
|
axisLabelRotationSlider->setTickPosition(QSlider::TicksBelow);
|
|
|
|
axisLabelRotationSlider->setMinimum(0);
|
|
|
|
axisLabelRotationSlider->setValue(30);
|
|
|
|
axisLabelRotationSlider->setMaximum(90);
|
|
|
|
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *modeGroup = new QButtonGroup(m_barsWidget);
|
|
|
|
auto *modeWeather = new QRadioButton(u"Temperature Data"_s, m_barsWidget);
|
2023-03-02 13:45:23 +00:00
|
|
|
modeWeather->setChecked(true);
|
2023-06-12 12:45:34 +00:00
|
|
|
auto *modeCustomProxy = new QRadioButton(u"Custom Proxy Data"_s, m_barsWidget);
|
2023-03-02 13:45:23 +00:00
|
|
|
modeGroup->addButton(modeWeather);
|
|
|
|
modeGroup->addButton(modeCustomProxy);
|
|
|
|
|
|
|
|
//! [4]
|
|
|
|
vLayout->addWidget(new QLabel(u"Rotate horizontally"_s));
|
|
|
|
vLayout->addWidget(rotationSliderX, 0, Qt::AlignTop);
|
|
|
|
//! [4]
|
|
|
|
vLayout->addWidget(new QLabel(u"Rotate vertically"_s));
|
|
|
|
vLayout->addWidget(rotationSliderY, 0, Qt::AlignTop);
|
|
|
|
vLayout->addWidget(labelButton, 0, Qt::AlignTop);
|
|
|
|
vLayout->addWidget(cameraButton, 0, Qt::AlignTop);
|
|
|
|
vLayout->addWidget(zoomToSelectedButton, 0, Qt::AlignTop);
|
|
|
|
vLayout->addWidget(backgroundCheckBox);
|
|
|
|
vLayout->addWidget(gridCheckBox);
|
|
|
|
vLayout->addWidget(smoothCheckBox);
|
|
|
|
vLayout->addWidget(seriesCheckBox);
|
|
|
|
vLayout->addWidget(reverseValueAxisCheckBox);
|
|
|
|
vLayout->addWidget(axisTitlesVisibleCB);
|
|
|
|
vLayout->addWidget(axisTitlesFixedCB);
|
|
|
|
vLayout->addWidget(new QLabel(u"Show year"_s));
|
|
|
|
vLayout->addWidget(rangeList);
|
|
|
|
vLayout->addWidget(new QLabel(u"Change bar style"_s));
|
|
|
|
vLayout->addWidget(barStyleList);
|
|
|
|
vLayout->addWidget(new QLabel(u"Change selection mode"_s));
|
|
|
|
vLayout->addWidget(selectionModeList);
|
|
|
|
vLayout->addWidget(new QLabel(u"Change theme"_s));
|
|
|
|
vLayout->addWidget(themeList);
|
|
|
|
vLayout->addWidget(new QLabel(u"Adjust shadow quality"_s));
|
|
|
|
vLayout->addWidget(shadowQuality);
|
|
|
|
vLayout->addWidget(new QLabel(u"Change font"_s));
|
|
|
|
vLayout->addWidget(fontList);
|
|
|
|
vLayout->addWidget(new QLabel(u"Adjust font size"_s));
|
|
|
|
vLayout->addWidget(fontSizeSlider);
|
|
|
|
vLayout->addWidget(new QLabel(u"Axis label rotation"_s));
|
|
|
|
vLayout->addWidget(axisLabelRotationSlider, 0, Qt::AlignTop);
|
|
|
|
vLayout->addWidget(modeWeather, 0, Qt::AlignTop);
|
|
|
|
vLayout->addWidget(modeCustomProxy, 1, Qt::AlignTop);
|
|
|
|
|
2023-08-04 07:54:41 +00:00
|
|
|
// Raise the graph to the top of the widget stack, to hide UI if resized smaller
|
|
|
|
m_barsGraph->raise();
|
|
|
|
|
2023-03-02 13:45:23 +00:00
|
|
|
//! [2]
|
2023-05-09 06:55:35 +00:00
|
|
|
m_modifier = new GraphModifier(m_barsGraph, this);
|
2024-04-16 13:40:26 +00:00
|
|
|
m_modifier->changeTheme(themeList->currentIndex());
|
2023-03-02 13:45:23 +00:00
|
|
|
//! [2]
|
|
|
|
|
|
|
|
//! [5]
|
2023-04-04 10:37:19 +00:00
|
|
|
QObject::connect(rotationSliderX, &QSlider::valueChanged, m_modifier, &GraphModifier::rotateX);
|
2023-03-02 13:45:23 +00:00
|
|
|
//! [5]
|
2023-04-04 10:37:19 +00:00
|
|
|
QObject::connect(rotationSliderY, &QSlider::valueChanged, m_modifier, &GraphModifier::rotateY);
|
2023-03-02 13:45:23 +00:00
|
|
|
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(labelButton,
|
|
|
|
&QPushButton::clicked,
|
|
|
|
m_modifier,
|
2023-03-02 13:45:23 +00:00
|
|
|
&GraphModifier::changeLabelBackground);
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(cameraButton,
|
|
|
|
&QPushButton::clicked,
|
|
|
|
m_modifier,
|
2023-03-02 13:45:23 +00:00
|
|
|
&GraphModifier::changePresetCamera);
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(zoomToSelectedButton,
|
|
|
|
&QPushButton::clicked,
|
|
|
|
m_modifier,
|
2023-03-02 13:45:23 +00:00
|
|
|
&GraphModifier::zoomToSelectedBar);
|
|
|
|
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(backgroundCheckBox,
|
2024-02-12 09:55:19 +00:00
|
|
|
&QCheckBox::checkStateChanged,
|
2023-10-12 06:37:46 +00:00
|
|
|
m_modifier,
|
2023-03-02 13:45:23 +00:00
|
|
|
&GraphModifier::setBackgroundEnabled);
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(gridCheckBox,
|
2024-02-12 09:55:19 +00:00
|
|
|
&QCheckBox::checkStateChanged,
|
2023-10-12 06:37:46 +00:00
|
|
|
m_modifier,
|
2023-03-02 13:45:23 +00:00
|
|
|
&GraphModifier::setGridEnabled);
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(smoothCheckBox,
|
2024-02-12 09:55:19 +00:00
|
|
|
&QCheckBox::checkStateChanged,
|
2023-10-12 06:37:46 +00:00
|
|
|
m_modifier,
|
2023-03-02 13:45:23 +00:00
|
|
|
&GraphModifier::setSmoothBars);
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(seriesCheckBox,
|
2024-02-12 09:55:19 +00:00
|
|
|
&QCheckBox::checkStateChanged,
|
2023-10-12 06:37:46 +00:00
|
|
|
m_modifier,
|
2023-03-02 13:45:23 +00:00
|
|
|
&GraphModifier::setSeriesVisibility);
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(reverseValueAxisCheckBox,
|
2024-02-12 09:55:19 +00:00
|
|
|
&QCheckBox::checkStateChanged,
|
2023-10-12 06:37:46 +00:00
|
|
|
m_modifier,
|
2023-03-02 13:45:23 +00:00
|
|
|
&GraphModifier::setReverseValueAxis);
|
|
|
|
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(m_modifier,
|
|
|
|
&GraphModifier::backgroundEnabledChanged,
|
|
|
|
backgroundCheckBox,
|
|
|
|
&QCheckBox::setChecked);
|
|
|
|
QObject::connect(m_modifier,
|
|
|
|
&GraphModifier::gridEnabledChanged,
|
|
|
|
gridCheckBox,
|
|
|
|
&QCheckBox::setChecked);
|
|
|
|
|
|
|
|
QObject::connect(rangeList,
|
|
|
|
&QComboBox::currentIndexChanged,
|
|
|
|
m_modifier,
|
2023-03-02 13:45:23 +00:00
|
|
|
&GraphModifier::changeRange);
|
|
|
|
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(barStyleList,
|
|
|
|
&QComboBox::currentIndexChanged,
|
|
|
|
m_modifier,
|
2023-03-02 13:45:23 +00:00
|
|
|
&GraphModifier::changeStyle);
|
|
|
|
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(selectionModeList,
|
|
|
|
&QComboBox::currentIndexChanged,
|
|
|
|
m_modifier,
|
2023-03-02 13:45:23 +00:00
|
|
|
&GraphModifier::changeSelectionMode);
|
|
|
|
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(themeList,
|
|
|
|
&QComboBox::currentIndexChanged,
|
|
|
|
m_modifier,
|
2023-03-02 13:45:23 +00:00
|
|
|
&GraphModifier::changeTheme);
|
|
|
|
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(shadowQuality,
|
|
|
|
&QComboBox::currentIndexChanged,
|
|
|
|
m_modifier,
|
2023-03-02 13:45:23 +00:00
|
|
|
&GraphModifier::changeShadowQuality);
|
|
|
|
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(m_modifier,
|
|
|
|
&GraphModifier::shadowQualityChanged,
|
|
|
|
shadowQuality,
|
2023-03-02 13:45:23 +00:00
|
|
|
&QComboBox::setCurrentIndex);
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(m_barsGraph,
|
|
|
|
&Q3DBars::shadowQualityChanged,
|
|
|
|
m_modifier,
|
2023-03-02 13:45:23 +00:00
|
|
|
&GraphModifier::shadowQualityUpdatedByVisual);
|
|
|
|
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(fontSizeSlider,
|
|
|
|
&QSlider::valueChanged,
|
|
|
|
m_modifier,
|
2023-03-02 13:45:23 +00:00
|
|
|
&GraphModifier::changeFontSize);
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(fontList,
|
|
|
|
&QFontComboBox::currentFontChanged,
|
|
|
|
m_modifier,
|
2023-03-02 13:45:23 +00:00
|
|
|
&GraphModifier::changeFont);
|
|
|
|
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(m_modifier,
|
|
|
|
&GraphModifier::fontSizeChanged,
|
|
|
|
fontSizeSlider,
|
2023-03-02 13:45:23 +00:00
|
|
|
&QSlider::setValue);
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(m_modifier,
|
|
|
|
&GraphModifier::fontChanged,
|
|
|
|
fontList,
|
2023-03-02 13:45:23 +00:00
|
|
|
&QFontComboBox::setCurrentFont);
|
|
|
|
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(axisTitlesVisibleCB,
|
2024-02-12 09:55:19 +00:00
|
|
|
&QCheckBox::checkStateChanged,
|
2023-10-12 06:37:46 +00:00
|
|
|
m_modifier,
|
2023-03-02 13:45:23 +00:00
|
|
|
&GraphModifier::setAxisTitleVisibility);
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(axisTitlesFixedCB,
|
2024-02-12 09:55:19 +00:00
|
|
|
&QCheckBox::checkStateChanged,
|
2023-10-12 06:37:46 +00:00
|
|
|
m_modifier,
|
2023-03-02 13:45:23 +00:00
|
|
|
&GraphModifier::setAxisTitleFixed);
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(axisLabelRotationSlider,
|
|
|
|
&QSlider::valueChanged,
|
|
|
|
m_modifier,
|
2023-03-02 13:45:23 +00:00
|
|
|
&GraphModifier::changeLabelRotation);
|
|
|
|
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(modeWeather,
|
|
|
|
&QRadioButton::toggled,
|
|
|
|
m_modifier,
|
2023-03-02 13:45:23 +00:00
|
|
|
&GraphModifier::setDataModeToWeather);
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(modeCustomProxy,
|
|
|
|
&QRadioButton::toggled,
|
|
|
|
m_modifier,
|
2023-03-02 13:45:23 +00:00
|
|
|
&GraphModifier::setDataModeToCustom);
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(modeWeather, &QRadioButton::toggled, seriesCheckBox, &QCheckBox::setEnabled);
|
|
|
|
QObject::connect(modeWeather, &QRadioButton::toggled, rangeList, &QComboBox::setEnabled);
|
|
|
|
QObject::connect(modeWeather,
|
|
|
|
&QRadioButton::toggled,
|
|
|
|
axisTitlesVisibleCB,
|
2023-03-02 13:45:23 +00:00
|
|
|
&QCheckBox::setEnabled);
|
2023-10-12 06:37:46 +00:00
|
|
|
QObject::connect(modeWeather, &QRadioButton::toggled, axisTitlesFixedCB, &QCheckBox::setEnabled);
|
|
|
|
QObject::connect(modeWeather,
|
|
|
|
&QRadioButton::toggled,
|
|
|
|
axisLabelRotationSlider,
|
2023-03-02 13:45:23 +00:00
|
|
|
&QSlider::setEnabled);
|
|
|
|
}
|