文章目录
前言
本节可在qt creator 帮助文档搜索QTimer和Timers
The QTimer class provides repetitive and single-shot timers.
一、Detailed Description
1.1 QTimer介绍
The QTimer class provides repetitive and single-shot timers.
The QTimer class provides a high-level programming interface for timers. To use it, create a QTimer, connect its timeout() signal to the appropriate slots, and call start(). From then on, it will emit the timeout() signal at constant intervals.
1.2 QTimer使用方法:4种
使用方法1:无限次数
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
timer->start(1000);
使用方法2:仅1次
You can set a timer to time out o