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 ().