[−][src]Trait qmetaobject::qmetatype::QMetaType
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!
#[derive(Default, Clone)] struct MyStruct(u32, String); impl QMetaType for MyStruct {}
Associated Constants
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
If this is set to a function, it enable the conversion to and from QString
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
Provided methods
fn register(name: Option<&CStr>) -> i32
Registers the type.
See the Qt documentation of qRegisterMetaType()
The default implementation should work for most types
fn id() -> i32
fn to_qvariant(&self) -> QVariant
Returns a QVariant containing a copy of this object
fn from_qvariant(variant: QVariant) -> Option<Self>
Attempt to convert from a QVariant to this type.
Implementations on Foreign Types
impl QMetaType for String
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
fn register(name: Option<&CStr>) -> i32
[src]
fn id() -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
impl QMetaType for ()
[src]
fn register(_name: Option<&CStr>) -> i32
[src]
fn id() -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
impl QMetaType for bool
[src]
fn register(_name: Option<&CStr>) -> i32
[src]
fn id() -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
impl QMetaType for i32
[src]
fn register(_name: Option<&CStr>) -> i32
[src]
fn id() -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
impl QMetaType for u32
[src]
fn register(_name: Option<&CStr>) -> i32
[src]
fn id() -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
impl QMetaType for i64
[src]
fn register(_name: Option<&CStr>) -> i32
[src]
fn id() -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
impl QMetaType for u64
[src]
fn register(_name: Option<&CStr>) -> i32
[src]
fn id() -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
impl QMetaType for f64
[src]
fn register(_name: Option<&CStr>) -> i32
[src]
fn id() -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
impl QMetaType for i16
[src]
fn register(_name: Option<&CStr>) -> i32
[src]
fn id() -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
impl QMetaType for i8
[src]
fn register(_name: Option<&CStr>) -> i32
[src]
fn id() -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
impl QMetaType for u16
[src]
fn register(_name: Option<&CStr>) -> i32
[src]
fn id() -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
impl QMetaType for u8
[src]
fn register(_name: Option<&CStr>) -> i32
[src]
fn id() -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
impl QMetaType for f32
[src]
fn register(_name: Option<&CStr>) -> i32
[src]
fn id() -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
impl QMetaType for isize
[src]
fn register(_name: Option<&CStr>) -> i32
[src]
fn id() -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
impl QMetaType for usize
[src]
fn register(_name: Option<&CStr>) -> i32
[src]
fn id() -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
Implementors
impl QMetaType for QByteArray
[src]
fn register(_name: Option<&CStr>) -> i32
[src]
fn id() -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
impl QMetaType for QColor
[src]
fn register(_name: Option<&CStr>) -> i32
[src]
fn id() -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
impl QMetaType for QImage
[src]
fn register(_name: Option<&CStr>) -> i32
[src]
fn id() -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
impl QMetaType for QModelIndex
[src]
fn register(_name: Option<&CStr>) -> i32
[src]
fn id() -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
impl QMetaType for QPointF
[src]
fn register(_name: Option<&CStr>) -> i32
[src]
fn id() -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
impl QMetaType for QRectF
[src]
fn register(_name: Option<&CStr>) -> i32
[src]
fn id() -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
impl QMetaType for QString
[src]
fn register(_name: Option<&CStr>) -> i32
[src]
fn id() -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
impl QMetaType for QVariant
[src]
fn register(_name: Option<&CStr>) -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
fn id() -> i32
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
impl QMetaType for QVariantList
[src]
fn register(_name: Option<&CStr>) -> i32
[src]
fn id() -> i32
[src]
fn to_qvariant(&self) -> QVariant
[src]
fn from_qvariant(variant: QVariant) -> Option<Self>
[src]
const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString>
[src]
const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self>
[src]
impl<T: QGadget> QMetaType for T where
T: Clone + Default + 'static,
[src]
T: Clone + Default + 'static,
QGadget are automatically QMetaType