PeriDyno 1.0.0
Loading...
Searching...
No Matches
QmDoubleSpinBox.cpp
Go to the documentation of this file.
1#include "QmDoubleSpinBox.h"
2
3#include "Module.h"
4#include "Node.h"
5#include "Field.h"
6#include "SceneGraphFactory.h"
7
8#include <QVBoxLayout>
9
10#include <memory>
11#include "QmValueDialog.h"
12
13namespace dyno
14{
15
16
18 : QDoubleSpinBox(parent)
19 {
20 //this->lineEdit()->setMouseTracking(true);
21
22 connect(this->lineEdit(), SIGNAL(textChanged(const QString&)), this, SLOT(LineEditStart()));
23 connect(this, SIGNAL(valueChanged(double)), this, SLOT(LineEditFinished(double)));
24
25 this->setDecimals(decimalsMax);
26 this->setKeyboardTracking(false);
27
28 }
29
31 {
32
33 return;
34 }
35
37 {
38
39 realValue = v;
40 this->setValue(realValue);
41
42 return;
43 }
44
45 void mDoubleSpinBox::wheelEvent(QWheelEvent* event)
46 {
47
48 }
49 void mDoubleSpinBox::contextMenuEvent(QContextMenuEvent* event)
50 {
51
52 if(ValueModify== nullptr)
53 ValueModify = new ValueDialog(this);
54 ValueModify->updateDialogPosition();
55 ValueModify->show();
56 }
57
58
59 void mDoubleSpinBox::mousePressEvent(QMouseEvent* event)
60 {
61 QDoubleSpinBox::mousePressEvent(event);
62
63 }
64
65 void mDoubleSpinBox::mouseReleaseEvent(QMouseEvent* event)
66 {
67 QDoubleSpinBox::mouseReleaseEvent(event);
68 }
69
70 void mDoubleSpinBox::mouseMoveEvent(QMouseEvent* event)
71 {
72 QDoubleSpinBox::mouseMoveEvent(event);
73
74 }
75
77 {
78 this->setRealValue(v);
79
80 }
81
83 {
84 this->setKeyboardTracking(true);
85 this->setRealValue(v);
86 this->lineEdit()->setText(QString::number(realValue, 10, displayDecimals));
87 this->setKeyboardTracking(false);
88 }
89
90
91}
92
double setRealValue(double val)
void mouseMoveEvent(QMouseEvent *event) override
ValueDialog * ValueModify
void contextMenuEvent(QContextMenuEvent *event) override
void wheelEvent(QWheelEvent *event)
void ModifyValueAndUpdate(double)
mDoubleSpinBox(QWidget *parent=nullptr)
void LineEditFinished(double)
void mousePressEvent(QMouseEvent *event) override
void mouseReleaseEvent(QMouseEvent *event) override
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25