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) -> <bool as QMetaTypeCompatible>::CompatibleType
fn from_compatible(from: &<bool as QMetaTypeCompatible>::CompatibleType) -> bool
Source§impl QMetaTypeCompatible for f32
impl QMetaTypeCompatible for f32
type CompatibleType = f32
fn to_compatible(&self) -> <f32 as QMetaTypeCompatible>::CompatibleType
fn from_compatible(from: &<f32 as QMetaTypeCompatible>::CompatibleType) -> f32
Source§impl QMetaTypeCompatible for f64
impl QMetaTypeCompatible for f64
type CompatibleType = f64
fn to_compatible(&self) -> <f64 as QMetaTypeCompatible>::CompatibleType
fn from_compatible(from: &<f64 as QMetaTypeCompatible>::CompatibleType) -> f64
Source§impl QMetaTypeCompatible for i8
impl QMetaTypeCompatible for i8
type CompatibleType = i8
fn to_compatible(&self) -> <i8 as QMetaTypeCompatible>::CompatibleType
fn from_compatible(from: &<i8 as QMetaTypeCompatible>::CompatibleType) -> i8
Source§impl QMetaTypeCompatible for i16
impl QMetaTypeCompatible for i16
type CompatibleType = i16
fn to_compatible(&self) -> <i16 as QMetaTypeCompatible>::CompatibleType
fn from_compatible(from: &<i16 as QMetaTypeCompatible>::CompatibleType) -> i16
Source§impl QMetaTypeCompatible for i32
impl QMetaTypeCompatible for i32
type CompatibleType = i32
fn to_compatible(&self) -> <i32 as QMetaTypeCompatible>::CompatibleType
fn from_compatible(from: &<i32 as QMetaTypeCompatible>::CompatibleType) -> i32
Source§impl QMetaTypeCompatible for i64
impl QMetaTypeCompatible for i64
type CompatibleType = i64
fn to_compatible(&self) -> <i64 as QMetaTypeCompatible>::CompatibleType
fn from_compatible(from: &<i64 as QMetaTypeCompatible>::CompatibleType) -> i64
Source§impl QMetaTypeCompatible for isize
impl QMetaTypeCompatible for isize
type CompatibleType = i64
fn to_compatible(&self) -> <isize as QMetaTypeCompatible>::CompatibleType
fn from_compatible( from: &<isize as QMetaTypeCompatible>::CompatibleType, ) -> isize
Source§impl QMetaTypeCompatible for u8
impl QMetaTypeCompatible for u8
type CompatibleType = u8
fn to_compatible(&self) -> <u8 as QMetaTypeCompatible>::CompatibleType
fn from_compatible(from: &<u8 as QMetaTypeCompatible>::CompatibleType) -> u8
Source§impl QMetaTypeCompatible for u16
impl QMetaTypeCompatible for u16
type CompatibleType = u16
fn to_compatible(&self) -> <u16 as QMetaTypeCompatible>::CompatibleType
fn from_compatible(from: &<u16 as QMetaTypeCompatible>::CompatibleType) -> u16
Source§impl QMetaTypeCompatible for u32
impl QMetaTypeCompatible for u32
type CompatibleType = u32
fn to_compatible(&self) -> <u32 as QMetaTypeCompatible>::CompatibleType
fn from_compatible(from: &<u32 as QMetaTypeCompatible>::CompatibleType) -> u32
Source§impl QMetaTypeCompatible for u64
impl QMetaTypeCompatible for u64
type CompatibleType = u64
fn to_compatible(&self) -> <u64 as QMetaTypeCompatible>::CompatibleType
fn from_compatible(from: &<u64 as QMetaTypeCompatible>::CompatibleType) -> u64
Source§impl QMetaTypeCompatible for usize
impl QMetaTypeCompatible for usize
type CompatibleType = u64
fn to_compatible(&self) -> <usize as QMetaTypeCompatible>::CompatibleType
fn from_compatible( from: &<usize as QMetaTypeCompatible>::CompatibleType, ) -> usize
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.