Files
sonobulus/src/TimerComponent.hpp
2026-06-05 22:26:39 -05:00

34 lines
449 B
C++

#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_;
};