widgets/vec3editor.cpp

changeset 255
5188f8a74a5c
parent 254
b7b29cb82360
child 264
76a025db4948
equal deleted inserted replaced
254:b7b29cb82360 255:5188f8a74a5c
11 } 11 }
12 12
13 VectorInput::VectorInput(QWidget *parent, QFlags<Flag> flags) : 13 VectorInput::VectorInput(QWidget *parent, QFlags<Flag> flags) :
14 QWidget{parent} 14 QWidget{parent}
15 { 15 {
16
17 this->ui.setupUi(this); 16 this->ui.setupUi(this);
18 if (flags.testFlag(NoMultiplyButton)) { 17 if (flags.testFlag(NoMultiplyButton)) {
19 this->ui.multiply->setVisible(false); 18 this->ui.multiply->setVisible(false);
20 } 19 }
21 else { 20 else {
48 set(this->ui.y, value.y); 47 set(this->ui.y, value.y);
49 set(this->ui.z, value.z); 48 set(this->ui.z, value.z);
50 Q_EMIT this->valueChanged(value); 49 Q_EMIT this->valueChanged(value);
51 } 50 }
52 51
52 qreal VectorInput::x() const
53 {
54 return this->ui.x->value();
55 }
56
57 qreal VectorInput::y() const
58 {
59 return this->ui.y->value();
60 }
61
62 qreal VectorInput::z() const
63 {
64 return this->ui.z->value();
65 }
66
67 void VectorInput::setX(qreal x)
68 {
69 this->ui.x->setValue(x);
70 }
71
72 void VectorInput::setY(qreal y)
73 {
74 this->ui.y->setValue(y);
75 }
76
77 void VectorInput::setZ(qreal z)
78 {
79 this->ui.z->setValue(z);
80 }
81
53 std::array<DoubleSpinBox*, 3> VectorInput::spinboxes() 82 std::array<DoubleSpinBox*, 3> VectorInput::spinboxes()
54 { 83 {
55 return {this->ui.x, this->ui.y, this->ui.z}; 84 return {this->ui.x, this->ui.y, this->ui.z};
56 } 85 }
57 86

mercurial