This commit is contained in:
flower_linux
2026-05-13 16:46:07 +08:00
commit 90ad86b4d0
52 changed files with 5251 additions and 0 deletions

20
src/fake_driver.cpp Normal file
View File

@@ -0,0 +1,20 @@
#include "fake_driver.hpp"
FakeDriver::FakeDriver(QObject* parent)
: QObject(parent)
{
connect(&m_timer, &QTimer::timeout, this, &FakeDriver::onTimeout);
}
void FakeDriver::start(int intervalMs, std::function<void()> onTick)
{
m_onTick = std::move(onTick);
m_timer.start(intervalMs);
}
void FakeDriver::onTimeout()
{
if (m_onTick) {
m_onTick();
}
}