-
Notifications
You must be signed in to change notification settings - Fork 0
/
myq3dscatter.cpp
64 lines (48 loc) · 1.95 KB
/
myq3dscatter.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include "myq3dscatter.h"
#include "scatterdatamodifier.h"
#include <QtWidgets/qboxlayout.h>
#include <QtWidgets/qcheckbox.h>
#include <QtWidgets/qcombobox.h>
#include <QtWidgets/qlabel.h>
#include <QtWidgets/qcommandlinkbutton.h>
using namespace Qt::StringLiterals;
MyQ3DScatter::MyQ3DScatter()
{
m_scatterGraph = new Q3DScatter();
}
MyQ3DScatter::~MyQ3DScatter() = default;
bool MyQ3DScatter::initialize()
{
if (!m_scatterGraph->hasContext())
return false;
m_scatterWidget = new QWidget;
auto *vLayout = new QVBoxLayout(m_scatterWidget);
m_container = QWidget::createWindowContainer(m_scatterGraph, m_scatterWidget);
m_container->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
m_container->setFocusPolicy(Qt::StrongFocus);
vLayout->addWidget(m_container, 1);
QSlider *timeSlider = new QSlider(Qt::Orientation::Horizontal);
timeSlider->setSliderDown(false);
timeSlider->setTickInterval(5);
timeSlider->setTickPosition(QSlider::TicksAbove);
vLayout->addWidget(timeSlider);
static auto *modifier = new ScatterDataModifier(m_scatterGraph, this);
QObject::connect(timeSlider, &QSlider::valueChanged, modifier, &ScatterDataModifier::toggleTimeStamp);
// QObject::connect(cameraButton, &QCommandLinkButton::clicked, modifier,
// &ScatterDataModifier::changePresetCamera);
// QObject::connect(itemCountButton, &QCommandLinkButton::clicked, modifier,
// &ScatterDataModifier::toggleItemCount);
QObject::connect(m_scatterGraph, &Q3DScatter::shadowQualityChanged, modifier,
&ScatterDataModifier::shadowQualityUpdatedByVisual);
QObject::connect(this, &MyQ3DScatter::receiveChange, modifier, &ScatterDataModifier::addData);
return true;
}
void MyQ3DScatter::addData()
{
qDebug() << "Run";
// m_scatterGraph->seriesList().at(0)->dataProxy()->addItem();
}
void MyQ3DScatter::receiveChange()
{
qDebug() << "CHANGED";
}