Skip to main content

QSignalSpy

Struct QSignalSpy 

Source
pub struct QSignalSpy { /* private fields */ }
Expand description

The QSignalSpy is a struct that enables introspection of signal emission.

A QSignalSpy can connect to a signal of a QObject and record each time the signal is emitted. QSignalSpy itself is a QVariantList. Each emission of the signal will append one item to the list, containing the arguments of the signal.

See also: QSignalSpy documentation.

Implementations§

Source§

impl QSignalSpy

Source

pub fn new(qobject: &QObject, signal_name: &str) -> UniquePtr<Self>

Creates a new QSignalSpy that listens for emissions of a signal of the qobject.

§Arguments
  • signal_name - The name of the signal function to observe.
Source

pub fn count(&self) -> isize

Returns the number of items currently stored in the underlying QList.

Source

pub fn take_at(self: Pin<&mut Self>, idx: isize) -> QVariantList

Removes the element at position idx from the underlying QList and returns it.

Source

pub fn take_first(self: Pin<&mut Self>) -> QVariantList

Removes the first item from the underlying QList and returns it.

Source

pub fn take_last(self: Pin<&mut Self>) -> QVariantList

Removes the last item from the underlying QList and returns it.

Trait Implementations§

Source§

impl ExternType for QSignalSpy

Source§

type Kind = Opaque

Source§

type Id

A type-level representation of the type’s C++ namespace and type name. Read more
Source§

impl UniquePtrTarget for QSignalSpy

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.