【Qt】Qt中的几种Timer

作者 : admin 本文共444个字,预计阅读时间需要2分钟 发布时间: 2024-06-9 共3人阅读

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.
本站无任何商业行为
个人在线分享 » 【Qt】Qt中的几种Timer
E-->