1. QObject::startTimer
int QObject::startTimer(int interval, Qt::TimerType timerType = Qt::CoarseTimer)
int QObject::startTimer(std::chrono::milliseconds time, Qt::TimerType timerType = Qt::CoarseTimer)
每次时间到了会调用虚函数timerEvent()
2. QTimer
3. QBasicTimer
参考
- Qt帮助文档:
TheQTimer
class provides a high-level programming interface with single-shot timers and timer signals instead of events. There is also aQBasicTimer
class that is more lightweight than QTimer and less clumsy than using timer IDs directly.
本站资源均来自互联网,仅供研究学习,禁止违法使用和商用,产生法律纠纷本站概不负责!如果侵犯了您的权益请与我们联系!
转载请注明出处: 免费源码网-免费的源码资源网站 » 【Qt】Qt中的几种Timer
发表评论 取消回复