QTimer, start, stop and start again
-
Hello,
I have a
QTimerthat repeatedly runs a function. I start it with an interval of 20 ms. Later I stop it. Then I start it again with the same interval of 20 ms. After that, I realize that the function is called twice as much as it was before I stopped theQTimerfor the first time. If I stop and start it again, then the function will be called thrice as much.It looks like
QTimer::stopdoesn't do what I hoped it would. How exactly can I stop aQTimerfrom running a function for some time, then make it resume with the same interval ? -
Hi,
Can you share the code you use to start and stop your QTimer ?
If it's called twice as much after a single stop/start sequence, it might be that you're connecting again your QTimer object to your slot.
-
Hi,
Can you share the code you use to start and stop your QTimer ?
If it's called twice as much after a single stop/start sequence, it might be that you're connecting again your QTimer object to your slot.