pub trait QMetaTypeCompatible {
type CompatibleType: QMetaTypeGet;
// Required methods
fn to_compatible(&self) -> Self::CompatibleType;
fn from_compatible(from: &Self::CompatibleType) -> Self;
// Provided method
fn compatible_qmetatype() -> QMetaType { ... }
}Expand description
Enables a type to be used as a meta call argument and to be convertible from/to QVariant.
Implemented for:
- Primitive numeric types and
bool StringVec<T>whereTis one of the aboveRc<RefCell<T>>whereTimplements [QObjectHolder]Vec<Rc<RefCell<T>>>whereTimplementsQmlElement
Required Associated Types§
type CompatibleType: QMetaTypeGet
Required Methods§
fn to_compatible(&self) -> Self::CompatibleType
fn from_compatible(from: &Self::CompatibleType) -> Self
Provided Methods§
fn compatible_qmetatype() -> QMetaType
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.
Implementations on Foreign Types§
Source§impl QMetaTypeCompatible for Value
Available on crate feature serde_json only.
impl QMetaTypeCompatible for Value
Available on crate feature
serde_json only.type CompatibleType = QJsonValue
fn to_compatible(&self) -> QJsonValue
fn from_compatible(from: &QJsonValue) -> Value
Source§impl QMetaTypeCompatible for bool
impl QMetaTypeCompatible for bool
type CompatibleType = bool
fn to_compatible(&self) -> Self::CompatibleType
fn from_compatible(from: &Self::CompatibleType) -> Self
Source§impl QMetaTypeCompatible for f32
impl QMetaTypeCompatible for f32
type CompatibleType = f32
fn to_compatible(&self) -> Self::CompatibleType
fn from_compatible(from: &Self::CompatibleType) -> Self
Source§impl QMetaTypeCompatible for f64
impl QMetaTypeCompatible for f64
type CompatibleType = f64
fn to_compatible(&self) -> Self::CompatibleType
fn from_compatible(from: &Self::CompatibleType) -> Self
Source§impl QMetaTypeCompatible for i8
impl QMetaTypeCompatible for i8
type CompatibleType = i8
fn to_compatible(&self) -> Self::CompatibleType
fn from_compatible(from: &Self::CompatibleType) -> Self
Source§impl QMetaTypeCompatible for i16
impl QMetaTypeCompatible for i16
type CompatibleType = i16
fn to_compatible(&self) -> Self::CompatibleType
fn from_compatible(from: &Self::CompatibleType) -> Self
Source§impl QMetaTypeCompatible for i32
impl QMetaTypeCompatible for i32
type CompatibleType = i32
fn to_compatible(&self) -> Self::CompatibleType
fn from_compatible(from: &Self::CompatibleType) -> Self
Source§impl QMetaTypeCompatible for i64
impl QMetaTypeCompatible for i64
type CompatibleType = i64
fn to_compatible(&self) -> Self::CompatibleType
fn from_compatible(from: &Self::CompatibleType) -> Self
Source§impl QMetaTypeCompatible for isize
impl QMetaTypeCompatible for isize
type CompatibleType = i64
fn to_compatible(&self) -> Self::CompatibleType
fn from_compatible(from: &Self::CompatibleType) -> Self
Source§impl QMetaTypeCompatible for u8
impl QMetaTypeCompatible for u8
type CompatibleType = u8
fn to_compatible(&self) -> Self::CompatibleType
fn from_compatible(from: &Self::CompatibleType) -> Self
Source§impl QMetaTypeCompatible for u16
impl QMetaTypeCompatible for u16
type CompatibleType = u16
fn to_compatible(&self) -> Self::CompatibleType
fn from_compatible(from: &Self::CompatibleType) -> Self
Source§impl QMetaTypeCompatible for u32
impl QMetaTypeCompatible for u32
type CompatibleType = u32
fn to_compatible(&self) -> Self::CompatibleType
fn from_compatible(from: &Self::CompatibleType) -> Self
Source§impl QMetaTypeCompatible for u64
impl QMetaTypeCompatible for u64
type CompatibleType = u64
fn to_compatible(&self) -> Self::CompatibleType
fn from_compatible(from: &Self::CompatibleType) -> Self
Source§impl QMetaTypeCompatible for usize
impl QMetaTypeCompatible for usize
type CompatibleType = u64
fn to_compatible(&self) -> Self::CompatibleType
fn from_compatible(from: &Self::CompatibleType) -> Self
Source§impl QMetaTypeCompatible for String
impl QMetaTypeCompatible for String
type CompatibleType = QString
fn to_compatible(&self) -> QString
fn from_compatible(from: &QString) -> String
Source§impl QMetaTypeCompatible for Vec<Value>
Available on crate feature serde_json only.
impl QMetaTypeCompatible for Vec<Value>
Available on crate feature
serde_json only.