Trait qmetaobject::QObject [−][src]
pub trait QObject { fn meta_object(&self) -> *const QMetaObject; fn static_meta_object() -> *const QMetaObject
where
Self: Sized; fn get_cpp_object(&self) -> *mut c_void; unsafe fn cpp_construct(pined: &RefCell<Self>) -> *mut c_void
where
Self: Sized; unsafe fn qml_construct(
pined: &RefCell<Self>,
mem: *mut c_void,
extra_destruct: extern "C" fn(_: *mut c_void)
)
where
Self: Sized; fn cpp_size() -> usize
where
Self: Sized; unsafe fn get_from_cpp<'a>(p: *mut c_void) -> QObjectPinned<'a, Self>
where
Self: Sized; fn get_object_description() -> &'static QObjectDescription
where
Self: Sized, { ... } }
Trait that is implemented by the QObject custom derive macro
Do not implement this trait yourself, use #[derive(QObject)]
.
The method of this trait fits into two categories: the ones that are re-implemented by the custom derive, and the ones that are used by this macro and need to be implemented by other QObject-like trait which you use in the qt_base_class! macro.
Required methods
fn meta_object(&self) -> *const QMetaObject
[src]
Returns a pointer to a meta object
fn static_meta_object() -> *const QMetaObject where
Self: Sized,
[src]
Self: Sized,
Returns a pointer to a meta object
fn get_cpp_object(&self) -> *mut c_void
[src]
return a C++ pointer to the QObject* (can be null if not yet initialized)
unsafe fn cpp_construct(pined: &RefCell<Self>) -> *mut c_void where
Self: Sized,
[src]
Self: Sized,
Construct the C++ Object.
Note, once this function is called, the object must not be moved in memory.
unsafe fn qml_construct(
pined: &RefCell<Self>,
mem: *mut c_void,
extra_destruct: extern "C" fn(_: *mut c_void)
) where
Self: Sized,
[src]
pined: &RefCell<Self>,
mem: *mut c_void,
extra_destruct: extern "C" fn(_: *mut c_void)
) where
Self: Sized,
Construct the C++ Object, suitable for callbacks to construct QML objects.
fn cpp_size() -> usize where
Self: Sized,
[src]
Self: Sized,
Return the size of the C++ object
unsafe fn get_from_cpp<'a>(p: *mut c_void) -> QObjectPinned<'a, Self> where
Self: Sized,
[src]
Self: Sized,
Return a rust object belonging to a C++ object
Provided methods
fn get_object_description() -> &'static QObjectDescription where
Self: Sized,
[src]
Self: Sized,
Returns a QObjectDescription for this type
Implementations
impl dyn QObject
[src]
pub unsafe fn as_qvariant(&self) -> QVariant
[src]
Creates a C++ object and construct a QVariant containing a pointer to it.
The cpp_construct function must already have been called.
FIXME: should probably not be used. Prefer using a QmlEngine::new_qobject. QVariant is unsafe as it does not manage life time
pub fn destroyed_signal() -> Signal<fn()>
[src]
See Qt documentation for QObject::destroyed
pub fn set_object_name(&self, name: QString)
[src]
See Qt documentation for QObject::setObjectName
pub fn object_name_changed_signal() -> Signal<fn(_: QString)>
[src]
See Qt documentation for QObject::objectNameChanged
Implementors
impl<T: SimpleListItem + 'static> QObject for SimpleListModel<T>
[src]
fn meta_object(&self) -> *const QMetaObject
[src]
fn static_meta_object() -> *const QMetaObject
[src]
fn get_cpp_object(&self) -> *mut c_void
[src]
unsafe fn get_from_cpp<'pinned_ref>(
ptr: *mut c_void
) -> QObjectPinned<'pinned_ref, Self>
[src]
ptr: *mut c_void
) -> QObjectPinned<'pinned_ref, Self>
unsafe fn cpp_construct(pinned: &RefCell<Self>) -> *mut c_void
[src]
unsafe fn qml_construct(
pinned: &RefCell<Self>,
mem: *mut c_void,
extra_destruct: extern "C" fn(_: *mut c_void)
)
[src]
pinned: &RefCell<Self>,
mem: *mut c_void,
extra_destruct: extern "C" fn(_: *mut c_void)
)