The QBasicTimer class provides timer events for objects. 更多...
| 头: | #include <QBasicTimer> |
| QBasicTimer () | |
| ~QBasicTimer () | |
| bool | isActive () const |
| void | start (int msec , QObject * object ) |
| void | stop () |
| int | timerId () const |
The QBasicTimer class provides timer events for objects.
这是用于 Qt 内部的快速、轻量、低级类。推荐使用更高级 QTimer 类而不是此类,若想要在应用程序中使用计时器。注意,该计时器是将发送后续计时器事件的重复计时器,除非 stop () 函数被调用。
To use this class, create a QBasicTimer , and call its start () 函数按超时间隔和采用指针指向 QObject 子类。当超时时,计时器会将计时器事件发送给 QObject 子类。可以在任何时候停止计时器,使用 stop (). isActive () returns true for a timer that is running; i.e. it has been started, has not reached the timeout time, and has not been stopped. The timer's ID can be retrieved using timerId ().
The Wiggly example uses QBasicTimer to repaint a widget at regular intervals.
另请参阅 QTimer , QTimerEvent , QObject::timerEvent (), 计时器 ,和 摆动范例 .
构造基本计时器。
另请参阅 start ().
销毁基本计时器。
Returns true if the timer is running and has not been stopped; otherwise returns false.
启动 (或重启) 计时器按 msec milliseconds timeout.
给定 object 将接收计时器事件。
另请参阅 stop (), isActive (),和 QObject::timerEvent ().
停止计时器。
返回计时器 ID。
另请参阅 QTimerEvent::timerId ().