Trait qmetaobject::qmetatype::QMetaType[][src]

pub trait QMetaType: Clone + Default + 'static {
    const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>;
    const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>;
    fn register(name: Option<&CStr>) -> i32 { ... }
fn id() -> i32 { ... }
fn to_qvariant(&self) -> QVariant { ... }
fn from_qvariant(variant: QVariant) -> Option<Self> { ... } }
Expand description

Implement this trait for type that should be known to the QMetaObject system

Once implemented for a type, it can be used as a type of a qt_property! or as a parameter of a qt_method!

use qmetaobject::QMetaType;

#[derive(Default, Clone)]
struct MyStruct(u32, String);

impl QMetaType for MyStruct {}

Associated Constants

If this is set to a function, it enable the conversion to and from QString

Provided methods

Registers the type.

See the Qt documentation of qRegisterMetaType()

The default implementation should work for most types

Returns a QVariant containing a copy of this object

Attempt to convert from a QVariant to this type.

Implementations on Foreign Types

Implementors