diff --git a/libs/piqt/qad_timers.h b/libs/piqt/qad_timers.h index 786fe3d..81d88ff 100644 --- a/libs/piqt/qad_timers.h +++ b/libs/piqt/qad_timers.h @@ -37,6 +37,7 @@ public: timers.clear(); } + void setIndexedTimerType(Index index, Qt::TimerType type) { timers[index].type = type; } void bindIndexedTimer(Index index, std::function func) { timers[index].func = func; } void stopIndexedTimer(Index index) { auto & t(timers[index]); @@ -52,6 +53,7 @@ public: return; } t.timer = new QTimer(); + t.timer->setTimerType(t.type); QObject::connect(t.timer, &QTimer::timeout, t.func); t.timer->start(interval.toMilliseconds()); } @@ -67,6 +69,7 @@ private: } std::function func = nullptr; QTimer * timer = nullptr; + Qt::TimerType type = Qt::CoarseTimer; }; QMap timers;