|
|
| CVariant () |
| | Default constructor.
|
| |
|
| CVariant (const CVariant &)=default |
| | Copy constructor.
|
| |
|
| CVariant (CVariant &&other) noexcept=default |
| | Move constructor.
|
| |
|
| CVariant (const QVariant &var) |
| | Construct from a QVariant.
|
| |
|
| CVariant (QVariant &&var) noexcept |
| | Move-construct from a QVariant.
|
| |
|
| CVariant (int)=delete |
| | Avoid unexpected implicit cast to QVariant::Type. (Use CVariant::from() instead.)
|
| |
|
| CVariant (const QString &string) |
| | Implicit conversion from QString.
|
| |
|
| CVariant (const char *string) |
| | Implicit conversion from C string.
|
| |
|
| CVariant (int typeId, const void *copy) |
| | Construct a variant from the given type and opaque pointer.
|
| |
|
void | reset (const QVariant &var) |
| | Change the internal QVariant.
|
| |
|
void | reset (QVariant &&var) |
| | Change the internal QVariant.
|
| |
|
CVariant & | operator= (const CVariant &other)=default |
| | Copy assignment operator.
|
| |
|
CVariant & | operator= (CVariant &&other) noexcept=default |
| | Move assignment operatior.
|
| |
|
CVariant & | operator= (const QVariant &var) |
| | Change the internal QVariant.
|
| |
|
CVariant & | operator= (QVariant &&var) noexcept |
| | Change the internal QVariant.
|
| |
|
void | swap (CVariant &other) noexcept |
| | Swap this variant with another.
|
| |
|
void | swap (QVariant &other) noexcept |
| | Swap the internal QVariant with another.
|
| |
|
template<typename T > |
| void | setValue (T &&value) |
| | Change the value.
|
| |
|
template<typename T > |
| void | set (T &&value) |
| | Synonym for setValue().
|
| |
|
template<typename T > |
| T | value () const |
| | Return the value converted to the type T.
|
| |
|
template<typename T > |
| T | to () const |
| | Synonym for value().
|
| |
| template<typename T > |
| T | valueOrDefault (T def) const |
| | Returns the value converted to the type T, or a default if it can not be converted. More...
|
| |
|
const QVariant & | getQVariant () const |
| | Return the internal QVariant.
|
| |
|
| operator const QVariant & () const |
| | Return the internal QVariant.
|
| |
|
| operator QVariant () && |
| | Return the internal QVariant.
|
| |
|
bool | canConvert (int typeId) const |
| | True if this variant can be converted to the type with the given metatype ID.
|
| |
|
template<typename T > |
| bool | canConvert () const |
| | True if this variant can be converted to the type T.
|
| |
|
bool | convert (int typeId) |
| | Convert this variant to the type with the given metatype ID and return true if successful.
|
| |
| QString | convertToQString (bool i18n=false) const |
| | Cast as QString. More...
|
| |
|
bool | isIntegral () const |
| | True if this variant's type is an integral type.
|
| |
|
bool | isArithmetic () const |
| | True if this variant's type is an integral or floating-point type.
|
| |
|
bool | toBool () const |
| | Convert this variant to a bool.
|
| |
|
int | toInt (bool *ok=nullptr) const |
| | Convert this variant to an integer.
|
| |
|
qlonglong | toLongLong (bool *ok=nullptr) const |
| | Convert this variant to a longlong integer.
|
| |
|
qulonglong | toULongLong (bool *ok=nullptr) const |
| | Convert this variant to a unsigned longlong integer.
|
| |
|
qint64 | toQInt64 (bool *ok=nullptr) const |
| | COnvert to qint64, which is used for all timestamps.
|
| |
|
double | toDouble (bool *ok=nullptr) const |
| | Convert this variant to double.
|
| |
|
QDateTime | toDateTime () const |
| | Convert this variant to QDateTime.
|
| |
|
QUrl | toUrl () const |
| | Convert this variant to QUrl.
|
| |
|
void | clear () |
| | Set the variant to null.
|
| |
|
bool | isNull () const |
| | True if this variant is null.
|
| |
|
bool | isValid () const |
| | True if this variant is valid.
|
| |
|
QMetaType::Type | type () const |
| | Return the metatype ID of the value in this variant, or QMetaType::User if it is a user type.
|
| |
|
const char * | typeName () const |
| | Return the typename of the value in this variant.
|
| |
|
int | userType () const |
| | Return the metatype ID of the value in this variant.
|
| |
|
QMetaType | metaType () const |
| | Return the QMetaType of the type in this variant.
|
| |
| QJsonObject | toJson () const |
| | Cast to JSON object. More...
|
| |
|
QString | toJsonString (QJsonDocument::JsonFormat format=QJsonDocument::Indented) const |
| | Convenience function JSON as string.
|
| |
| void | convertFromJson (const QJsonObject &json) |
| | Assign from JSON object. More...
|
| |
|
CStatusMessage | convertFromJsonNoThrow (const QJsonObject &json, const CLogCategoryList &categories, const QString &prefix) |
| | Call convertFromJson, catch any CJsonException that is thrown and return it as CStatusMessage.
|
| |
|
QJsonObject | toMemoizedJson () const |
| | To compact JSON format.
|
| |
|
void | convertFromMemoizedJson (const QJsonObject &json, bool allowFallbackToJson) |
| | From compact JSON format.
|
| |
|
CStatusMessage | convertFromMemoizedJsonNoThrow (const QJsonObject &json, const CLogCategoryList &categories, const QString &prefix) |
| | Call convertFromMemoizedJson, catch any CJsonException that is thrown and return it as CStatusMessage.
|
| |
| void | marshallToDbus (QDBusArgument &argument) const |
| | Marshall without begin/endStructure, for when composed within another object. More...
|
| |
| void | unmarshallFromDbus (const QDBusArgument &argument) |
| | Unmarshall without begin/endStructure, for when composed within another object. More...
|
| |
| void | marshalToDataStream (QDataStream &stream) const |
| | Marshal a value to a QDataStream. More...
|
| |
| void | unmarshalFromDataStream (QDataStream &stream) |
| | Unmarshal a value from a QDataStream. More...
|
| |
| void | setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant) |
| | Set property by index. More...
|
| |
| QVariant | propertyByIndex (swift::misc::CPropertyIndexRef index) const |
| | Property by index. More...
|
| |
| bool | equalsPropertyByIndex (const CVariant &compareValue, CPropertyIndexRef index) const |
| | Is given variant equal to value of property index? More...
|
| |
| QPixmap | toPixmap () const |
| | Corresponding pixmap. More...
|
| |
| CIcons::IconIndex | toIcon () const |
| | As icon, not implemented by all classes. More...
|
| |
| int | getMetaTypeId () const |
| | Returns the Qt meta type ID of this object. More...
|
| |
| QString | getClassName () const |
| | Class name. More...
|
| |
| bool | isA (int metaTypeId) const |
| | Returns true if this object is an instance of the class with the given meta type ID, or one of its subclasses. More...
|
| |
|
bool | matches (const CVariant &event) const |
| | If this is an event subscription, return true if it matches the given event.
|
| |
|
QString | toQString (bool i18n=false) const |
| | Cast as QString.
|
| |
|
std::string | toStdString (bool i18n=false) const |
| | To std string.
|
| |
|
QString | stringForStreaming () const |
| | String for streaming operators.
|
| |
Wrapper around QVariant which provides transparent access to CValueObject methods of the contained object if it is registered with swift::misc::registerMetaValueType.
Definition at line 59 of file variant.h.