#[repr(C)]
pub struct QVariant { /* private fields */ }
Expand description
The QVariant class acts like a union for the most common Qt data types.
Convert this variant to type QMetaType::UnknownType and free up any resources used.
Returns true if this is a null variant, false otherwise.
Returns true if the storage type of this variant is not QMetaType::UnknownType; otherwise returns false.
Returns the stored value converted to the template type T
if QVariant::canConvert is true otherwise returns None
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
.
Constructs a copy of the variant, p, passed as the argument to this constructor.
Performs copy-assignment from
source
.
Read more
Constructs an invalid variant.
Destroys the QVariant and the contained object.
A type-level representation of the type’s C++ namespace and type name.
Read more
Constructs a QVariant from a value of T
This method tests for self
and other
values to be equal, and is used
by ==
.
This method tests for !=
. The default implementation is almost always
sufficient, and should not be overridden without very good reason.
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more
Uses borrowed data to replace owned data, usually by cloning.
Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.