How to reset WTimer timeout?
Added by Markus Wolters almost 9 years ago
Hi everyone,
I have the situation, that I have to reset the timer interval if an event happens (nothing special here).
My problem is, that the interval is only resetted if the timeout elapse, not if I stop/start the timer. I have tried resetTimer->setInterval(10000) before the start() method too, but with same result. Is there a special trick to reset the interval? Or any ideas what I'm doing wrong here?
Thanks in advance...
init:
resetTimer = new Wt::WTimer();
resetTimer->setInterval(10000);
resetTimer->timeout().connect(this, &StatusView::onResetTimeout);
resetTimer->setSingleShot(true);
resetTimer->start();
event method:
resetTimer->stop();
doMyStuff();
resetTimer->start();
Replies (1)
RE: How to reset WTimer timeout? - Added by Koen Deforche almost 9 years ago
Hey Markus,
That could very well be a bug. As a workaround, you should delete the timer and recreate it.
Can you file this a s bug report?
Koen