b1128646fc
remove Qt 3 files copy Qt 4 from qt4/devel Wed Mar 12 2008 Kevin Kofler <Kevin@tigcc.ticalc.org> 4.3.4-6 - rename to qt on Fedora >= 9
159 lines
6.0 KiB
Diff
159 lines
6.0 KiB
Diff
--- src/corelib/tools/qmap.h
|
|
+++ src/corelib/tools/qmap.h
|
|
@@ -185,6 +185,7 @@ public:
|
|
|
|
class iterator
|
|
{
|
|
+ friend class const_iterator;
|
|
QMapData::Node *i;
|
|
|
|
public:
|
|
@@ -240,9 +241,9 @@ public:
|
|
public:
|
|
#endif
|
|
inline bool operator==(const const_iterator &o) const
|
|
- { return i == reinterpret_cast<const iterator &>(o).i; }
|
|
+ { return i == o.i; }
|
|
inline bool operator!=(const const_iterator &o) const
|
|
- { return i != reinterpret_cast<const iterator &>(o).i; }
|
|
+ { return i != o.i; }
|
|
|
|
private:
|
|
// ### Qt 5: remove
|
|
@@ -252,6 +253,7 @@ public:
|
|
|
|
class const_iterator
|
|
{
|
|
+ friend class iterator;
|
|
QMapData::Node *i;
|
|
|
|
public:
|
|
@@ -270,7 +272,7 @@ public:
|
|
#else
|
|
inline const_iterator(const iterator &o)
|
|
#endif
|
|
- { i = reinterpret_cast<const const_iterator &>(o).i; }
|
|
+ { i = o.i; }
|
|
|
|
inline const Key &key() const { return concrete(i)->key; }
|
|
inline const T &value() const { return concrete(i)->value; }
|
|
--- src/corelib/tools/qset.h
|
|
+++ src/corelib/tools/qset.h
|
|
@@ -84,6 +84,7 @@ public:
|
|
{
|
|
typedef QHash<T, QHashDummyValue> Hash;
|
|
typename Hash::iterator i;
|
|
+ friend class const_iterator;
|
|
|
|
public:
|
|
typedef std::bidirectional_iterator_tag iterator_category;
|
|
@@ -101,9 +102,9 @@ public:
|
|
inline bool operator==(const iterator &o) const { return i == o.i; }
|
|
inline bool operator!=(const iterator &o) const { return i != o.i; }
|
|
inline bool operator==(const const_iterator &o) const
|
|
- { return i == reinterpret_cast<const iterator &>(o).i; }
|
|
+ { return i == o.i; }
|
|
inline bool operator!=(const const_iterator &o) const
|
|
- { return i != reinterpret_cast<const iterator &>(o).i; }
|
|
+ { return i != o.i; }
|
|
inline iterator &operator++() { ++i; return *this; }
|
|
inline iterator operator++(int) { iterator r = *this; ++i; return r; }
|
|
inline iterator &operator--() { --i; return *this; }
|
|
@@ -118,6 +119,7 @@ public:
|
|
{
|
|
typedef QHash<T, QHashDummyValue> Hash;
|
|
typename Hash::const_iterator i;
|
|
+ friend class iterator;
|
|
|
|
public:
|
|
typedef std::bidirectional_iterator_tag iterator_category;
|
|
@@ -130,7 +132,7 @@ public:
|
|
inline const_iterator(typename Hash::const_iterator o) : i(o) {}
|
|
inline const_iterator(const const_iterator &o) : i(o.i) {}
|
|
inline const_iterator(const iterator &o)
|
|
- : i(reinterpret_cast<const const_iterator &>(o).i) {}
|
|
+ : i(o.i) {}
|
|
inline const_iterator &operator=(const const_iterator &o) { i = o.i; return *this; }
|
|
inline const T &operator*() const { return i.key(); }
|
|
inline const T *operator->() const { return &i.key(); }
|
|
--- src/corelib/tools/qhash.h
|
|
+++ src/corelib/tools/qhash.h
|
|
@@ -291,6 +291,7 @@ public:
|
|
|
|
class iterator
|
|
{
|
|
+ friend class const_iterator;
|
|
QHashData::Node *i;
|
|
|
|
public:
|
|
@@ -343,9 +344,9 @@ public:
|
|
public:
|
|
#endif
|
|
inline bool operator==(const const_iterator &o) const
|
|
- { return i == reinterpret_cast<const iterator &>(o).i; }
|
|
+ { return i == o.i; }
|
|
inline bool operator!=(const const_iterator &o) const
|
|
- { return i != reinterpret_cast<const iterator &>(o).i; }
|
|
+ { return i != o.i; }
|
|
|
|
private:
|
|
// ### Qt 5: remove
|
|
@@ -355,6 +356,7 @@ public:
|
|
|
|
class const_iterator
|
|
{
|
|
+ friend class iterator;
|
|
QHashData::Node *i;
|
|
|
|
public:
|
|
@@ -374,7 +376,7 @@ public:
|
|
#else
|
|
inline const_iterator(const iterator &o)
|
|
#endif
|
|
- { i = reinterpret_cast<const const_iterator &>(o).i; }
|
|
+ { i = o.i; }
|
|
|
|
inline const Key &key() const { return concrete(i)->key; }
|
|
inline const T &value() const { return concrete(i)->value; }
|
|
--- src/corelib/tools/qlist.h
|
|
+++ src/corelib/tools/qlist.h
|
|
@@ -162,17 +162,17 @@ public:
|
|
inline bool operator>=(const iterator& other) const { return i >= other.i; }
|
|
#ifndef QT_STRICT_ITERATORS
|
|
inline bool operator==(const const_iterator &o) const
|
|
- { return i == reinterpret_cast<const iterator &>(o).i; }
|
|
+ { return i == o.i; }
|
|
inline bool operator!=(const const_iterator &o) const
|
|
- { return i != reinterpret_cast<const iterator &>(o).i; }
|
|
+ { return i != o.i; }
|
|
inline bool operator<(const const_iterator& other) const
|
|
- { return i < reinterpret_cast<const iterator &>(other).i; }
|
|
+ { return i < other.i; }
|
|
inline bool operator<=(const const_iterator& other) const
|
|
- { return i <= reinterpret_cast<const iterator &>(other).i; }
|
|
+ { return i <= other.i; }
|
|
inline bool operator>(const const_iterator& other) const
|
|
- { return i > reinterpret_cast<const iterator &>(other).i; }
|
|
+ { return i > other.i; }
|
|
inline bool operator>=(const const_iterator& other) const
|
|
- { return i >= reinterpret_cast<const iterator &>(other).i; }
|
|
+ { return i >= other.i; }
|
|
#endif
|
|
inline iterator &operator++() { ++i; return *this; }
|
|
inline iterator operator++(int) { Node *n = i; ++i; return n; }
|
|
--- src/corelib/tools/qlinkedlist.h
|
|
+++ src/corelib/tools/qlinkedlist.h
|
|
@@ -119,9 +119,9 @@ public:
|
|
inline bool operator==(const iterator &o) const { return i == o.i; }
|
|
inline bool operator!=(const iterator &o) const { return i != o.i; }
|
|
inline bool operator==(const const_iterator &o) const
|
|
- { return i == reinterpret_cast<const iterator &>(o).i; }
|
|
+ { return i == o.i; }
|
|
inline bool operator!=(const const_iterator &o) const
|
|
- { return i != reinterpret_cast<const iterator &>(o).i; }
|
|
+ { return i != o.i; }
|
|
inline iterator &operator++() { i = i->n; return *this; }
|
|
inline iterator operator++(int) { Node *n = i; i = i->n; return n; }
|
|
inline iterator &operator--() { i = i->p; return *this; }
|
|
|