Struct cxx_qt_lib::QVariant
source · #[repr(C)]pub struct QVariant { /* private fields */ }
Expand description
The QVariant class acts like a union for the most common Qt data types.
Implementations§
source§impl QVariant
impl QVariant
sourcepub fn value<T: QVariantValue>(&self) -> Option<T>
pub fn value<T: QVariantValue>(&self) -> Option<T>
Returns the stored value converted to the template type T if QVariant::canConvert is true otherwise returns None
sourcepub fn value_or_default<T: QVariantValue>(&self) -> T
pub fn value_or_default<T: QVariantValue>(&self) -> T
Returns the stored value converted to the template type T
If the value cannot be converted, a default-constructed value will be returned.
Note that this calls the QVariant::value
method, without performance loss.
Whereas value
first calls QVariant::canConvert
.
Trait Implementations§
source§impl ExternType for QVariant
impl ExternType for QVariant
source§impl PartialEq for QVariant
impl PartialEq for QVariant
source§impl QListElement for QVariant
impl QListElement for QVariant
type TypeId = (Q, L, i, s, t, __, Q, V, a, r, i, a, n, t)
fn append(list: &mut QList<Self>, value: Self)
fn append_clone(list: &mut QList<Self>, value: &Self)
fn clear(list: &mut QList<Self>)
fn clone(list: &QList<Self>) -> QList<Self>
fn contains(list: &QList<Self>, value: &Self) -> bool
fn default() -> QList<Self>
fn drop(list: &mut QList<Self>)
fn index_of(list: &QList<Self>, value: &Self) -> isize
fn insert(list: &mut QList<Self>, pos: isize, value: Self)
fn insert_clone(list: &mut QList<Self>, pos: isize, value: &Self)
fn len(list: &QList<Self>) -> isize
fn remove(list: &mut QList<Self>, pos: isize)
fn reserve(list: &mut QList<Self>, size: isize)
source§impl QVectorElement for QVariant
impl QVectorElement for QVariant
type TypeId = (Q, V, e, c, t, o, r, __, Q, V, a, r, i, a, n, t)
fn append(vector: &mut QVector<Self>, value: Self)
fn append_clone(vector: &mut QVector<Self>, value: &Self)
fn clear(vector: &mut QVector<Self>)
fn clone(vector: &QVector<Self>) -> QVector<Self>
fn contains(vector: &QVector<Self>, value: &Self) -> bool
fn default() -> QVector<Self>
fn drop(vector: &mut QVector<Self>)
fn index_of(vector: &QVector<Self>, value: &Self) -> isize
fn insert(vector: &mut QVector<Self>, pos: isize, value: Self)
fn insert_clone(vector: &mut QVector<Self>, pos: isize, value: &Self)
fn len(vector: &QVector<Self>) -> isize
fn remove(vector: &mut QVector<Self>, pos: isize)
fn reserve(vector: &mut QVector<Self>, size: isize)
Auto Trait Implementations§
impl Freeze for QVariant
impl RefUnwindSafe for QVariant
impl Send for QVariant
impl Sync for QVariant
impl Unpin for QVariant
impl UnwindSafe for QVariant
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more