Files
z-bar-qt/Plugins/ZShell/Services/tickingservice.hpp
T
zach 5618ba9e6b
C++ / fmt (pull_request) Failing after 5s
C++ / build (pull_request) Failing after 9s
C++ / clang-tidy (pull_request) Failing after 9s
JS/TS / fmt (pull_request) Successful in 10s
JS/TS / lint (pull_request) Successful in 9s
Python / static (pull_request) Successful in 32s
Rust / build (pull_request) Successful in 52s
Python / verify (pull_request) Successful in 1m45s
Rust / fmt (pull_request) Successful in 33s
Rust / clippy (pull_request) Successful in 58s
fix: fix nvidia update interval on config change + more robust read path for generic
2026-09-28 12:32:36 +02:00

40 lines
652 B
C++

#pragma once
#include <qtimer.h>
#include "service.hpp"
namespace ZShell::services {
class TickingService : public Service {
Q_OBJECT
Q_PROPERTY(
int updateInterval READ updateInterval NOTIFY updateIntervalChanged)
public:
explicit TickingService(QObject* parent = nullptr);
[[nodiscard]] int updateInterval() const;
signals:
void updateIntervalChanged();
void updateTriggered();
protected:
void start() final;
void stop() final;
virtual void tick() = 0;
virtual void onStopped() {}
private:
void applyInterval(int ms);
QTimer* m_timer;
int m_interval = 1000;
bool m_running = false;
};
} // namespace ZShell::services