QTimer, start, stop and start again
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 the
QTimerfor 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 a
QTimerfrom running a function for some time, then make it resume with the same interval ?
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.
it might be that you're connecting again your QTimer object to your slot.
That's exactly what I was doing! Thanks a lot, everything works perfectly now.