[−][src]Struct qt_core::QSignalBlocker
Exception-safe wrapper around QObject::blockSignals()
C++ class: QSignalBlocker
.
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<MutPtr<QObject>>
) -> CppBox<QSignalBlocker>
[src]
o: impl CastInto<MutPtr<QObject>>
) -> CppBox<QSignalBlocker>
Constructor. Calls object->blockSignals(true).
Calls C++ function: [constructor] void QSignalBlocker::QSignalBlocker(QObject* o)
.
Constructor. Calls object->blockSignals(true).
pub unsafe fn from_q_object2(
o: impl CastInto<MutRef<QObject>>
) -> CppBox<QSignalBlocker>
[src]
o: impl CastInto<MutRef<QObject>>
) -> CppBox<QSignalBlocker>
This is an overloaded function.
Calls C++ function: [constructor] void QSignalBlocker::QSignalBlocker(QObject& o)
.
This is an overloaded function.
Calls object.blockSignals(true).
pub unsafe fn reblock(&mut self)
[src]
Re-blocks signals after a previous unblock().
Calls C++ function: void QSignalBlocker::reblock()
.
pub unsafe fn unblock(&mut 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()
.
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(&mut 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()
.
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
impl RefUnwindSafe for QSignalBlocker
impl Send for QSignalBlocker
impl Sync for QSignalBlocker
impl Unpin for QSignalBlocker
impl UnwindSafe for QSignalBlocker
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>,