[][src]Struct qt_core::QSignalBlocker

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

Exception-safe wrapper around QObject::blockSignals()

C++ class: QSignalBlocker.

C++ documentation:

Exception-safe wrapper around QObject::blockSignals()

QSignalBlocker can be used whereever you would otherwise use a pair of calls to blockSignals(). It blocks signals in its constructor and in the destructor it resets the state to what it was before the constructor ran.

{ const QSignalBlocker blocker(someQObject); // no signals here }

is thus equivalent to

const bool wasBlocked = someQObject->blockSignals(true); // no signals here someQObject->blockSignals(wasBlocked);

except the code using QSignalBlocker is safe in the face of exceptions.

Methods

impl QSignalBlocker[src]

pub unsafe fn from_q_object(
    o: impl CastInto<Ptr<QObject>>
) -> CppBox<QSignalBlocker>
[src]

Constructor. Calls object->blockSignals(true).

Calls C++ function: [constructor] void QSignalBlocker::QSignalBlocker(QObject* o).

C++ documentation:

Constructor. Calls object->blockSignals(true).

pub unsafe fn from_q_object2(
    o: impl CastInto<Ref<QObject>>
) -> CppBox<QSignalBlocker>
[src]

This is an overloaded function.

Calls C++ function: [constructor] void QSignalBlocker::QSignalBlocker(QObject& o).

C++ documentation:

This is an overloaded function.

Calls object.blockSignals(true).

pub unsafe fn reblock(&self)[src]

Re-blocks signals after a previous unblock().

Calls C++ function: void QSignalBlocker::reblock().

C++ documentation:

Re-blocks signals after a previous unblock().

The numbers of reblock() and unblock() calls are not counted, so every reblock() undoes any number of unblock() calls.

pub unsafe fn unblock(&self)[src]

Temporarily restores the QObject::signalsBlocked() state to what it was before this QSignaBlocker's constructor ran. To undo, use reblock().

Calls C++ function: void QSignalBlocker::unblock().

C++ documentation:

Temporarily restores the QObject::signalsBlocked() state to what it was before this QSignaBlocker's constructor ran. To undo, use reblock().

The numbers of reblock() and unblock() calls are not counted, so every unblock() undoes any number of reblock() calls.

Trait Implementations

impl CppDeletable for QSignalBlocker[src]

unsafe fn delete(&self)[src]

Destructor. Restores the QObject::signalsBlocked() state to what it was before the constructor ran, unless unblock() has been called without a following reblock(), in which case it does nothing.

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

C++ documentation:

Destructor. Restores the QObject::signalsBlocked() state to what it was before the constructor ran, unless unblock() has been called without a following reblock(), in which case it does nothing.

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.