src/widgets/vec3editor.cpp

changeset 206
654661eab7f3
parent 86
4bec0525ef1b
equal deleted inserted replaced
205:1a4342d80de7 206:654661eab7f3
32 { 32 {
33 } 33 }
34 34
35 glm::vec3 Vec3Editor::value() const 35 glm::vec3 Vec3Editor::value() const
36 { 36 {
37 auto get = [](DoubleSpinBox* spinbox){ return toFloat(spinbox->value()); }; 37 auto get = [](DoubleSpinBox* spinbox){ return float_cast(spinbox->value()); };
38 return {get(this->ui->x), get(this->ui->y), get(this->ui->z)}; 38 return {get(this->ui->x), get(this->ui->y), get(this->ui->z)};
39 } 39 }
40 40
41 void Vec3Editor::setValue(const glm::vec3& value) 41 void Vec3Editor::setValue(const glm::vec3& value)
42 { 42 {
43 auto set = [](DoubleSpinBox* spinbox, float value) 43 auto set = [](DoubleSpinBox* spinbox, float value)
44 { 44 {
45 QSignalBlocker blocker{spinbox}; 45 QSignalBlocker blocker{spinbox};
46 spinbox->setValue(toQreal(value)); 46 spinbox->setValue(qreal_cast(value));
47 }; 47 };
48 set(this->ui->x, value.x); 48 set(this->ui->x, value.x);
49 set(this->ui->y, value.y); 49 set(this->ui->y, value.y);
50 set(this->ui->z, value.z); 50 set(this->ui->z, value.z);
51 Q_EMIT this->valueChanged(value); 51 Q_EMIT this->valueChanged(value);

mercurial