diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2013-09-16 21:00:53 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-19 09:05:56 +0200 |
commit | 4c83183e711fb61d10f7c2475cbdbb04c4c36802 (patch) | |
tree | 076f90700a8428b386c225a0864fd08a499383da /src/corelib/kernel/qvariant.h | |
parent | 09f9c6e1b9b5f0c2e8066444600106d41301bc6b (diff) |
MetaType: Add assignment operator to the container iterators.
Change-Id: Ib4f2197a0ab6bd41c91de667cd3087fb40e44097
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/kernel/qvariant.h')
-rw-r--r-- | src/corelib/kernel/qvariant.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index 1f35850043..b6d5c1aebd 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -602,6 +602,16 @@ public: ref->ref(); } + inline const_iterator& operator=(const const_iterator &other) + { + if (!m_impl.equal(other.m_impl)) { + m_impl = other.m_impl; + ref = other.ref; + } + ref->ref(); + return *this; + } + inline const QVariant operator*() const { const QtMetaTypePrivate::VariantData d = m_impl.getCurrent(); if (d.metaTypeId == qMetaTypeId<QVariant>()) @@ -671,6 +681,16 @@ public: ref->ref(); } + inline const_iterator& operator=(const const_iterator &other) + { + if (!m_impl.equal(other.m_impl)) { + m_impl = other.m_impl; + ref = other.ref; + } + ref->ref(); + return *this; + } + inline const QVariant key() const { const QtMetaTypePrivate::VariantData d = m_impl.getCurrentKey(); QVariant v(d.metaTypeId, d.data, d.flags); |