diff options
Diffstat (limited to 'src/corelib/serialization/qjsonobject.cpp')
| -rw-r--r-- | src/corelib/serialization/qjsonobject.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/corelib/serialization/qjsonobject.cpp b/src/corelib/serialization/qjsonobject.cpp index beeb3b5a549..419021a7988 100644 --- a/src/corelib/serialization/qjsonobject.cpp +++ b/src/corelib/serialization/qjsonobject.cpp @@ -205,11 +205,14 @@ QJsonObject &QJsonObject::operator =(const QJsonObject &other) The keys in \a map will be used as the keys in the JSON object, and the QVariant values will be converted to JSON values. + \note Conversion from \l QVariant is not completely lossless. Please see + the documentation in QJsonValue::fromVariant() for more information. + \sa fromVariantHash(), toVariantMap(), QJsonValue::fromVariant() */ QJsonObject QJsonObject::fromVariantMap(const QVariantMap &map) { - return QCborMap::fromVariantMap(map).toJsonObject(); + return QJsonPrivate::Variant::toJsonObject(map); } /*! @@ -231,6 +234,9 @@ QVariantMap QJsonObject::toVariantMap() const The keys in \a hash will be used as the keys in the JSON object, and the QVariant values will be converted to JSON values. + \note Conversion from \l QVariant is not completely lossless. Please see + the documentation in QJsonValue::fromVariant() for more information. + \sa fromVariantMap(), toVariantHash(), QJsonValue::fromVariant() */ QJsonObject QJsonObject::fromVariantHash(const QVariantHash &hash) |
