widgets/vec3editor.cpp

changeset 255
5188f8a74a5c
parent 254
b7b29cb82360
child 264
76a025db4948
--- a/widgets/vec3editor.cpp	Wed Jun 22 21:46:38 2022 +0300
+++ b/widgets/vec3editor.cpp	Wed Jun 22 22:50:37 2022 +0300
@@ -13,7 +13,6 @@
 VectorInput::VectorInput(QWidget *parent, QFlags<Flag> flags) :
 	QWidget{parent}
 {
-	
 	this->ui.setupUi(this);
 	if (flags.testFlag(NoMultiplyButton)) {
 		this->ui.multiply->setVisible(false);
@@ -50,6 +49,36 @@
 	Q_EMIT this->valueChanged(value);
 }
 
+qreal VectorInput::x() const
+{
+	return this->ui.x->value();
+}
+
+qreal VectorInput::y() const
+{
+	return this->ui.y->value();
+}
+
+qreal VectorInput::z() const
+{
+	return this->ui.z->value();
+}
+
+void VectorInput::setX(qreal x)
+{
+	this->ui.x->setValue(x);
+}
+
+void VectorInput::setY(qreal y)
+{
+	this->ui.y->setValue(y);
+}
+
+void VectorInput::setZ(qreal z)
+{
+	this->ui.z->setValue(z);
+}
+
 std::array<DoubleSpinBox*, 3> VectorInput::spinboxes()
 {
 	return {this->ui.x, this->ui.y, this->ui.z};

mercurial