--- a/widgets/vec3editor.h Wed Jun 22 21:42:10 2022 +0300 +++ b/widgets/vec3editor.h Wed Jun 22 21:46:38 2022 +0300 @@ -1,22 +1,20 @@ #pragma once #include <QWidget> #include <glm/glm.hpp> +#include "ui_vec3editor.h" -namespace Ui -{ - class Vec3Editor; -} - -class Vec3Editor : public QWidget +class VectorInput : public QWidget { Q_OBJECT + Ui_Vec3Editor ui; public: enum Flag { NoMultiplyButton = 0x1 }; - explicit Vec3Editor(const glm::vec3& value, QWidget* parent = nullptr, QFlags<Flag> flags = {}); - ~Vec3Editor(); + explicit VectorInput(const glm::vec3& value, QWidget* parent = nullptr, QFlags<Flag> flags = {}); + explicit VectorInput(QWidget* parent = nullptr, QFlags<Flag> flags = {}); + ~VectorInput(); glm::vec3 value() const; void setValue(const glm::vec3& value); Q_SIGNALS: @@ -24,7 +22,6 @@ private: std::array<class DoubleSpinBox*, 3> spinboxes(); Q_SLOT void multiplyPressed(); - std::unique_ptr<Ui::Vec3Editor> ui; }; -Q_DECLARE_OPERATORS_FOR_FLAGS(QFlags<Vec3Editor::Flag>) +Q_DECLARE_OPERATORS_FOR_FLAGS(QFlags<VectorInput::Flag>)