[−][src]Struct qt_core::QBasicTimer
The QBasicTimer class provides timer events for objects.
C++ class: QBasicTimer
.
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]
&mut self,
other: impl CastInto<Ref<QBasicTimer>>
) -> MutRef<QBasicTimer>
The QBasicTimer class provides timer events for objects.
Calls C++ function: QBasicTimer& QBasicTimer::operator=(const QBasicTimer& other)
.
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
.
pub unsafe fn new() -> CppBox<QBasicTimer>
[src]
Contructs a basic timer.
Calls C++ function: [constructor] void QBasicTimer::QBasicTimer()
.
Contructs a basic timer.
See also start().
pub unsafe fn new_copy(
other: impl CastInto<Ref<QBasicTimer>>
) -> CppBox<QBasicTimer>
[src]
other: impl CastInto<Ref<QBasicTimer>>
) -> CppBox<QBasicTimer>
The QBasicTimer class provides timer events for objects.
Calls C++ function: [constructor] void QBasicTimer::QBasicTimer(const QBasicTimer& other)
.
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]
&mut self,
msec: c_int,
obj: impl CastInto<MutPtr<QObject>>
)
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)
.
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]
&mut self,
msec: c_int,
timer_type: TimerType,
obj: impl CastInto<MutPtr<QObject>>
)
This is an overloaded function.
Calls C++ function: void QBasicTimer::start(int msec, Qt::TimerType timerType, QObject* obj)
.
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()
.
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
.
Returns the timer's ID.
See also QTimerEvent::timerId().
Trait Implementations
impl CppDeletable for QBasicTimer
[src]
Auto Trait Implementations
impl RefUnwindSafe for QBasicTimer
impl Send for QBasicTimer
impl Sync for QBasicTimer
impl Unpin for QBasicTimer
impl UnwindSafe for QBasicTimer
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> CastInto<U> for T where
U: CastFrom<T>,
[src]
U: CastFrom<T>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> StaticUpcast<T> for T
[src]
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
[src]
unsafe fn static_upcast_mut(ptr: MutPtr<T>) -> MutPtr<T>
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,