summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization/qjsonvalue.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/serialization/qjsonvalue.h')
-rw-r--r--src/corelib/serialization/qjsonvalue.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/serialization/qjsonvalue.h b/src/corelib/serialization/qjsonvalue.h
index a9dd86df19..4b59dede01 100644
--- a/src/corelib/serialization/qjsonvalue.h
+++ b/src/corelib/serialization/qjsonvalue.h
@@ -180,6 +180,10 @@ public:
QJsonArray toArray() const;
QJsonObject toObject() const;
+ const QJsonValue operator[](QStringView key) const { return toValue()[key]; }
+ const QJsonValue operator[](QLatin1String key) const { return toValue()[key]; }
+ const QJsonValue operator[](qsizetype i) const { return toValue()[i]; }
+
inline bool operator==(const QJsonValue &other) const { return toValue() == other; }
inline bool operator!=(const QJsonValue &other) const { return toValue() != other; }