diff options
Diffstat (limited to 'src/corelib/json/qjsondocument.h')
-rw-r--r-- | src/corelib/json/qjsondocument.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/corelib/json/qjsondocument.h b/src/corelib/json/qjsondocument.h index 19885a8d56..4e76af21e2 100644 --- a/src/corelib/json/qjsondocument.h +++ b/src/corelib/json/qjsondocument.h @@ -93,6 +93,23 @@ public: QJsonDocument(const QJsonDocument &other); QJsonDocument &operator =(const QJsonDocument &other); + QJsonDocument(QJsonDocument &&other) Q_DECL_NOTHROW + : d(other.d) + { + other.d = nullptr; + } + + QJsonDocument &operator =(QJsonDocument &&other) Q_DECL_NOTHROW + { + swap(other); + return *this; + } + + void swap(QJsonDocument &other) Q_DECL_NOTHROW + { + qSwap(d, other.d); + } + enum DataValidation { Validate, BypassValidation @@ -131,6 +148,10 @@ public: void setObject(const QJsonObject &object); void setArray(const QJsonArray &array); + const QJsonValue operator[](const QString &key) const; + const QJsonValue operator[](QLatin1String key) const; + const QJsonValue operator[](int i) const; + bool operator==(const QJsonDocument &other) const; bool operator!=(const QJsonDocument &other) const { return !(*this == other); } @@ -147,6 +168,8 @@ private: QJsonPrivate::Data *d; }; +Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QJsonDocument) + #if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_JSON_READONLY) Q_CORE_EXPORT QDebug operator<<(QDebug, const QJsonDocument &); #endif |