#pragma once #include #include class TimerComponent : public QObject { Q_OBJECT Q_PROPERTY(int seconds READ seconds NOTIFY secondsChanged) public: explicit TimerComponent(QObject* parent = nullptr); int seconds() const { return seconds_; } public slots: void reset(); signals: void secondsChanged(); private: void increment(); int seconds_ = 0; QTimer timer_; };