[][src]Struct qt_core::QBasicTimer

#[repr(C)]
pub struct QBasicTimer { /* fields omitted */ }

The QBasicTimer class provides timer events for objects.

C++ class: QBasicTimer.

C++ documentation:

The QBasicTimer class provides timer events for objects.

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() function is called.

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

Methods

impl QBasicTimer[src]

pub unsafe fn copy_from(
    &mut self,
    other: impl CastInto<Ref<QBasicTimer>>
) -> MutRef<QBasicTimer>
[src]

The QBasicTimer class provides timer events for objects.

Calls C++ function: QBasicTimer& QBasicTimer::operator=(const QBasicTimer& other).

C++ documentation:

The QBasicTimer class provides timer events for objects.

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() function is called.

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

pub unsafe fn is_active(&self) -> bool[src]

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

Calls C++ function: bool QBasicTimer::isActive() const.

C++ documentation:

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

See also start() and stop().

pub unsafe fn new() -> CppBox<QBasicTimer>[src]

Contructs a basic timer.

Calls C++ function: [constructor] void QBasicTimer::QBasicTimer().

C++ documentation:

Contructs a basic timer.

See also start().

pub unsafe fn new_copy(
    other: impl CastInto<Ref<QBasicTimer>>
) -> CppBox<QBasicTimer>
[src]

The QBasicTimer class provides timer events for objects.

Calls C++ function: [constructor] void QBasicTimer::QBasicTimer(const QBasicTimer& other).

C++ documentation:

The QBasicTimer class provides timer events for objects.

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() function is called.

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

pub unsafe fn start_2a(
    &mut self,
    msec: c_int,
    obj: impl CastInto<MutPtr<QObject>>
)
[src]

Starts (or restarts) the timer with a msec milliseconds timeout. The timer will be a Qt::CoarseTimer. See Qt::TimerType for information on the different timer types.

Calls C++ function: void QBasicTimer::start(int msec, QObject* obj).

C++ documentation:

Starts (or restarts) the timer with a msec milliseconds timeout. The timer will be a Qt::CoarseTimer. See Qt::TimerType for information on the different timer types.

The given object will receive timer events.

See also stop(), isActive(), QObject::timerEvent(), and Qt::CoarseTimer.

pub unsafe fn start_3a(
    &mut self,
    msec: c_int,
    timer_type: TimerType,
    obj: impl CastInto<MutPtr<QObject>>
)
[src]

This is an overloaded function.

Calls C++ function: void QBasicTimer::start(int msec, Qt::TimerType timerType, QObject* obj).

C++ documentation:

This is an overloaded function.

Starts (or restarts) the timer with a msec milliseconds timeout and the given timerType. See Qt::TimerType for information on the different timer types.

obj will receive timer events.

See also stop(), isActive(), QObject::timerEvent(), and Qt::TimerType.

pub unsafe fn stop(&mut self)[src]

Stops the timer.

Calls C++ function: void QBasicTimer::stop().

C++ documentation:

Stops the timer.

See also start() and isActive().

pub unsafe fn swap(&mut self, other: impl CastInto<MutRef<QBasicTimer>>)[src]

Calls C++ function: void QBasicTimer::swap(QBasicTimer& other).

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn timer_id(&self) -> c_int[src]

Returns the timer's ID.

Calls C++ function: int QBasicTimer::timerId() const.

C++ documentation:

Returns the timer's ID.

See also QTimerEvent::timerId().

Trait Implementations

impl CppDeletable for QBasicTimer[src]

unsafe fn delete(&mut self)[src]

Destroys the basic timer.

Calls C++ function: [destructor] void QBasicTimer::~QBasicTimer().

C++ documentation:

Destroys the basic timer.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.