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帮助文档:
    The QTimer class provides a high-level programming interface with single-shot timers and timer signals instead of events. There is also a QBasicTimer class that is more lightweight than QTimer and less clumsy than using timer IDs directly.

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部