Compare commits

...

1 Commits

Author SHA1 Message Date
bf11ca21c0 add IndexedTimer::stopAllIndexedTimers 2025-03-04 19:59:36 +03:00

View File

@@ -31,15 +31,16 @@
template<typename Index = int>
class QAD_UTILS_EXPORT IndexedTimer {
public:
~IndexedTimer() {
for (auto & i: timers)
i.destroy();
timers.clear();
}
~IndexedTimer() { stopAllIndexedTimers(); }
void setIndexedTimerType(Index index, Qt::TimerType type) { timers[index].type = type; }
void setIndexedTimerSingleShot(Index index, bool yes) { timers[index].single_shot = yes; }
void bindIndexedTimer(Index index, std::function<void()> func) { timers[index].func = func; }
void stopAllIndexedTimers() {
for (auto & i: timers)
i.destroy();
timers.clear();
}
void stopIndexedTimer(Index index) {
auto & t(timers[index]);
if (!t.isValid()) return;