QBasicTimerclass provides timer events for objects. 更多 …
This is a fast, lightweight, and low-level class used by Qt internally. We recommend using the higher-level
QTimerclass rather than this class if you want to use timers in your applications. Note that this timer is a repeating timer that will send subsequent timer events unless thestop()函数被调用。To use this class, create a
QBasicTimer, and call itsstart()function with a timeout interval and with a pointer to aQObjectsubclass. When the timer times out it will send a timer event to theQObjectsubclass. The timer can be stopped at any time usingstop().isActive()返回truefor 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 usingtimerId().Objects of this class cannot be copied, but can be moved, so you can maintain a list of basic timers by holding them in container that supports move-only types, e.g. std::vector.
Wiggly example uses
QBasicTimerto repaint a widget at regular intervals.另请参阅
QBasicTimer
¶
QBasicTimer(arg__1)
注意
This constructor is deprecated.
- param arg__1
构造基本计时器。
另请参阅
PySide2.QtCore.QBasicTimer.
isActive
(
)
¶
bool
返回
true
if the timer is running and has not been stopped; otherwise returns
false
.
PySide2.QtCore.QBasicTimer.
start
(
msec
,
obj
)
¶
msec
–
int
obj
–
QObject
Starts (or restarts) the timer with a
msec
milliseconds timeout. The timer will be a
CoarseTimer
。见
TimerType
for information on the different timer types.
给定
object
将接收计时器事件。
另请参阅
stop()
isActive()
timerEvent()
CoarseTimer
PySide2.QtCore.QBasicTimer.
start
(
msec
,
timerType
,
obj
)
¶
msec
–
int
timerType
–
TimerType
obj
–
QObject
这是重载函数。
Starts (or restarts) the timer with a
msec
milliseconds timeout and the given
timerType
。见
TimerType
for information on the different timer types.
obj
将接收计时器事件。
另请参阅
stop()
isActive()
timerEvent()
TimerType
PySide2.QtCore.QBasicTimer.
stop
(
)
¶
停止计时器。
另请参阅
PySide2.QtCore.QBasicTimer.
swap
(
other
)
¶
other
–
QBasicTimer