diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-09-10 18:25:02 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-09-19 11:14:30 +0200 |
commit | 5c808073af5b8f1290602fcccf60666c9a3682f8 (patch) | |
tree | 97545220e79498a2dc2bb95f41da14ecce75cbd0 /src/corelib/kernel/qvariant.h | |
parent | b30801f64db5211bfb4392f13a6ff06d30288cb5 (diff) |
Extend QSequentialIterable and add QAssociativeIterable
And add mutable iterators. This requires some refactoring of the
existing iterators.
Task-number: QTBUG-81716
Change-Id: I61b3a3e8c0df5fd449679257a29d9f0c3d19c4f0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/kernel/qvariant.h')
-rw-r--r-- | src/corelib/kernel/qvariant.h | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index f9d46472b0..1825d4be88 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -580,61 +580,6 @@ inline bool operator!=(const QVariant &v1, const QVariantComparisonHelper &v2) #endif Q_DECLARE_SHARED(QVariant) -class Q_CORE_EXPORT QAssociativeIterable -{ - QtMetaTypePrivate::QAssociativeIterableImpl m_impl; -public: - struct Q_CORE_EXPORT const_iterator - { - private: - QtMetaTypePrivate::QAssociativeIterableImpl m_impl; - QAtomicInt *ref; - friend class QAssociativeIterable; - explicit const_iterator(const QAssociativeIterable &iter, QAtomicInt *ref_); - - explicit const_iterator(const QtMetaTypePrivate::QAssociativeIterableImpl &impl, QAtomicInt *ref_); - - void begin(); - void end(); - void find(const QVariant &key); - public: - ~const_iterator(); - const_iterator(const const_iterator &other); - - const_iterator& operator=(const const_iterator &other); - - const QVariant key() const; - - const QVariant value() const; - - const QVariant operator*() const; - bool operator==(const const_iterator &o) const; - bool operator!=(const const_iterator &o) const; - const_iterator &operator++(); - const_iterator operator++(int); - const_iterator &operator--(); - const_iterator operator--(int); - const_iterator &operator+=(int j); - const_iterator &operator-=(int j); - const_iterator operator+(int j) const; - const_iterator operator-(int j) const; - friend inline const_iterator operator+(int j, const const_iterator &k) { return k + j; } - }; - - friend struct const_iterator; - - explicit QAssociativeIterable(const QtMetaTypePrivate::QAssociativeIterableImpl &impl); - QAssociativeIterable() {} - - const_iterator begin() const; - const_iterator end() const; - const_iterator find(const QVariant &key) const; - - QVariant value(const QVariant &key) const; - - int size() const; -}; - #ifndef QT_MOC template<typename T> inline T qvariant_cast(const QVariant &v) |