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 "src/colors.h" class ColorIndexInput : public QWidget { Q_OBJECT const ColorTable* colorTable = nullptr; class Ui_ColorIndexInput& ui; public: ColorIndexInput(QWidget *parent = nullptr); ~ColorIndexInput(); ldraw::Color selectedColor() const; void setSelectedColor(ldraw::Color color); Q_SIGNALS: void colorChanged(ldraw::Color color); private: };