diff options
Diffstat (limited to 'src/corelib/serialization/qjsondocument.h')
-rw-r--r-- | src/corelib/serialization/qjsondocument.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/corelib/serialization/qjsondocument.h b/src/corelib/serialization/qjsondocument.h index 72e1b9a5c2..3659f7b5cb 100644 --- a/src/corelib/serialization/qjsondocument.h +++ b/src/corelib/serialization/qjsondocument.h @@ -4,6 +4,7 @@ #ifndef QJSONDOCUMENT_H #define QJSONDOCUMENT_H +#include <QtCore/qcompare.h> #include <QtCore/qjsonvalue.h> #include <QtCore/qscopedpointer.h> @@ -80,7 +81,7 @@ public: static QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error = nullptr); -#if !defined(QT_JSON_READONLY) || defined(Q_CLANG_QDOC) +#if !defined(QT_JSON_READONLY) || defined(Q_QDOC) QByteArray toJson(JsonFormat format = Indented) const; #endif @@ -94,22 +95,23 @@ public: void setObject(const QJsonObject &object); void setArray(const QJsonArray &array); -#if QT_STRINGVIEW_LEVEL < 2 const QJsonValue operator[](const QString &key) const; -#endif const QJsonValue operator[](QStringView key) const; const QJsonValue operator[](QLatin1StringView key) const; const QJsonValue operator[](qsizetype i) const; - +#if QT_CORE_REMOVED_SINCE(6, 8) bool operator==(const QJsonDocument &other) const; - bool operator!=(const QJsonDocument &other) const { return !(*this == other); } - + bool operator!=(const QJsonDocument &other) const { return !operator==(other); } +#endif bool isNull() const; private: friend class QJsonValue; friend class QJsonPrivate::Parser; friend Q_CORE_EXPORT QDebug operator<<(QDebug, const QJsonDocument &); + friend Q_CORE_EXPORT bool comparesEqual(const QJsonDocument &lhs, + const QJsonDocument &rhs) noexcept; + Q_DECLARE_EQUALITY_COMPARABLE(QJsonDocument) QJsonDocument(const QCborValue &data); |