内容表

上一话题

QBasicMutex

下一话题

QBitArray

QBasicTimer

QBasicTimer class provides timer events for objects. 更多

Inheritance diagram of PySide2.QtCore.QBasicTimer

概要

函数

详细描述

This is a fast, lightweight, and low-level class used by Qt internally. We recommend using the higher-level QTimer class 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 the stop() 函数被调用。

To use this class, create a QBasicTimer , and call its start() function with a timeout interval and with a pointer to a QObject subclass. When the timer times out it will send a timer event to the QObject subclass. The timer can be stopped at any time using stop() . isActive() 返回 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() .

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 QBasicTimer to repaint a widget at regular intervals.

class QBasicTimer

QBasicTimer(arg__1)

注意

This constructor is deprecated.

param arg__1

QBasicTimer

构造基本计时器。

另请参阅

start()

PySide2.QtCore.QBasicTimer. isActive ( )
返回类型

bool

返回 true if the timer is running and has not been stopped; otherwise returns false .

另请参阅

start() stop()

PySide2.QtCore.QBasicTimer. start ( msec , obj )
参数

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 将接收计时器事件。

PySide2.QtCore.QBasicTimer. stop ( )

停止计时器。

PySide2.QtCore.QBasicTimer. swap ( other )
参数

other QBasicTimer

PySide2.QtCore.QBasicTimer. timerId ( )
返回类型

int

Returns the timer’s ID.

另请参阅

timerId()