How to call a function periodically in Qt?

后端 未结 5 1269
耶瑟儿~
耶瑟儿~ 2021-02-14 22:10

Is it possible to call a function periodically in C++ with Qt function ?
And how to stop the timed function after it is set to be called periodically ?

5条回答
  •  迷失自我
    2021-02-14 22:49

    As people have said in answers before me, you can use the timeout() signal to trigger a function to run.

    If you want to stop the timer at some point, you can connect to the stop() slot, or call it directly yourself.

提交回复
热议问题