diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2021-11-11 11:10:27 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-02-15 17:00:02 -0800 |
commit | 3c7b507d1c0f9d1fd645ff5244391f9e4aab51eb (patch) | |
tree | 5844e075c2bf268008a9fb77b176a9d9c5858e4e /src/corelib/serialization/qcbormap.h | |
parent | e7706429bba50256cd12549cef21f8e6b1bea117 (diff) |
QCborValueRef: add a test to confirm that its methods reflect QCborValue
This has found several missing const qualifications, a missing
QCborMap::Iterator method, and a missing one in QCborValue too.
The methods "### TEMPORARY" in this commit are actually removed in two
commits.
Change-Id: I5e52dc5b093c43a3b678fffd16b6939f62954dc4
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'src/corelib/serialization/qcbormap.h')
-rw-r--r-- | src/corelib/serialization/qcbormap.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/serialization/qcbormap.h b/src/corelib/serialization/qcbormap.h index ed9c2f21d5..965e39b306 100644 --- a/src/corelib/serialization/qcbormap.h +++ b/src/corelib/serialization/qcbormap.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2018 Intel Corporation. +** Copyright (C) 2022 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -85,6 +85,7 @@ public: } value_type operator*() const { return { {item.d, item.i - 1}, item }; } + value_type operator[](qsizetype j) const { return *(*this + j); } QCborValueRef *operator->() const { return &item; } QCborValue key() const { return QCborValueRef(item.d, item.i - 1); } QCborValueRef value() const { return item; } @@ -137,6 +138,7 @@ public: } value_type operator*() const { return { {item.d, item.i - 1}, item }; } + value_type operator[](qsizetype j) const { return *(*this + j); } const QCborValueRef *operator->() const { return &item; } QCborValue key() const { return QCborValueRef(item.d, item.i - 1); } QCborValueRef value() const { return item; } |