From 47420cf19a0a42381833adc7d10915a58a162285 Mon Sep 17 00:00:00 2001 From: peri4 Date: Sun, 24 Mar 2024 20:23:15 +0300 Subject: [PATCH] IndexedTimer type --- libs/piqt/qad_timers.h | 3 +++ 1 file changed, 3 insertions(+) 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;