QList: partially revert ab8366b592

That commit removed the user-defined copy constructors,
under the assumption that this would be ok for these
non-exported classes. But the change is still BiC,
because it turns the iterators into trivial types,
which changes the way they are passed into functions
by value.

So, delay the change until Qt 6.

Change-Id: I8065ff1ff78f5722505328447f2496777d1e8957
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
bb10
Marc Mutz 2015-05-16 18:22:46 +02:00 committed by Olivier Goffart (Woboq GmbH)
parent 03281150b9
commit ea92ee8e15
1 changed files with 10 additions and 0 deletions

View File

@ -221,6 +221,11 @@ public:
inline iterator() : i(0) {}
inline iterator(Node *n) : i(n) {}
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
// can't remove it in Qt 5, since doing so would make the type trivial,
// which changes the way it's passed to functions by value.
inline iterator(const iterator &o): i(o.i){}
#endif
inline T &operator*() const { return i->t(); }
inline T *operator->() const { return &i->t(); }
inline T &operator[](difference_type j) const { return i[j].t(); }
@ -268,6 +273,11 @@ public:
inline const_iterator() : i(0) {}
inline const_iterator(Node *n) : i(n) {}
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
// can't remove it in Qt 5, since doing so would make the type trivial,
// which changes the way it's passed to functions by value.
inline const_iterator(const const_iterator &o): i(o.i) {}
#endif
#ifdef QT_STRICT_ITERATORS
inline explicit const_iterator(const iterator &o): i(o.i) {}
#else