Sun, 09 Apr 2023 15:59:08 +0300
Extracted the state of the program into a MainState structure, and extracted local functions of main() into static functions.
I was planning to make the core logic and state of the program into a Main class, which would be a QObject that would
have lots of signals and slots, but it looks like this works even without it
#pragma once #include <QDialog> #include "widgets/vec3editor.h" namespace Ui { class MultiplyFactorDialog; } class MultiplyFactorDialog : public QDialog { Q_OBJECT public: explicit MultiplyFactorDialog(const glm::vec3& baseVector = glm::vec3{}, QWidget *parent = nullptr); ~MultiplyFactorDialog(); glm::vec3 value() const; private: Q_SLOT void updatePreview(); std::unique_ptr<Ui::MultiplyFactorDialog> ui; const glm::vec3 baseVector; VectorInput preview; };