QJsonValueRef: add missing operator[]

Change-Id: Iae165cd7bb2a7ea02d819fa25e0618d81f9a54f4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Fabian Kosmale 2021-02-21 20:27:46 +01:00
parent d1fcc5d94a
commit 50e857a9cb

View File

@ -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; }