Struct qt_3d_input::slots::SlotMouseDeviceMutPtr
source · pub struct SlotMouseDeviceMutPtr<'a> { /* private fields */ }
Expand description
Allows to bind Qt signals with arguments (Qt3DInput::QMouseDevice*)
to a Rust closure.
Create an object using new()
and bind your closure using set()
.
The closure will be called with the signal’s arguments when the slot is invoked.
Use connect()
method of a qt_core::connection::Signal
object to connect the signal
to this slot. The closure will be executed each time the slot is invoked
until source signals are disconnected or the slot object is destroyed.
The slot object takes ownership of the passed closure. If set()
is called again,
previously set closure is dropped. Make sure that the slot object does not outlive
objects referenced by the closure.
If set()
was not called, slot invokation has no effect.
Implementations§
source§impl<'a> SlotMouseDeviceMutPtr<'a>
impl<'a> SlotMouseDeviceMutPtr<'a>
sourcepub fn new<F: FnMut(*mut MouseDevice) + 'a>(f: F) -> SlotMouseDeviceMutPtr<'a>
pub fn new<F: FnMut(*mut MouseDevice) + 'a>(f: F) -> SlotMouseDeviceMutPtr<'a>
Constructs a new object.
sourcepub fn set<F: FnMut(*mut MouseDevice) + 'a>(&mut self, f: F)
pub fn set<F: FnMut(*mut MouseDevice) + 'a>(&mut self, f: F)
Sets f
as the callback closure. If set()
is called again, previous closure is dropped.