pub trait QObjectHolder:
DispatchMetaCall
+ QMetaInfo
+ Default {
// Provided methods
fn default_with_attached_qobject() -> Rc<RefCell<Self>> { ... }
fn attach_qobject(instance: &Rc<RefCell<Self>>) { ... }
fn detach_qobject(&self) { ... }
fn as_qvariant(&self) -> QVariant { ... }
}Provided Methods§
Sourcefn default_with_attached_qobject() -> Rc<RefCell<Self>>
fn default_with_attached_qobject() -> Rc<RefCell<Self>>
Create a new default-initialized instance of this type and attach
the required [QObject]. This enables use of this instance in QML.
Instances created with this function must remain at its original heap
location and must not be moved out of Rc<RefCell<T>>.
Sourcefn attach_qobject(instance: &Rc<RefCell<Self>>)
fn attach_qobject(instance: &Rc<RefCell<Self>>)
Create and attach a dedicated [QObject] to the instance.
The instance must remain at its original heap location and must
not be moved out of Rc<RefCell<T>>.
Sourcefn detach_qobject(&self)
fn detach_qobject(&self)
Detach and remove the dedicated [QObject] from the specified object.
This function is intended to be called during the Drop implementation
of this type.
Sourcefn as_qvariant(&self) -> QVariant
fn as_qvariant(&self) -> QVariant
Return a QVariant containing a pointer to this object.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.