This commit is contained in:
2026-06-05 22:26:39 -05:00
parent de199fd8a1
commit 6fba54f9c0
6 changed files with 154 additions and 11 deletions

33
src/TimerComponent.hpp Normal file
View File

@@ -0,0 +1,33 @@
#pragma once
#include <QObject>
#include <QTimer>
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_;
};