45 #include <QtCore/qhash.h> 53 template <
class Key,
class T>
68 if (n.p) n.p->n = n.n;
69 if (n.n) n.n->p = n.p;
84 if (n.p) n.p->n = n.n;
85 if (n.n) n.n->p = n.p;
121 bool remove(
const Key &
key);
128 inline QT3_SUPPORT T *find(
const Key &key)
const {
return object(key); }
133 template <
class Key,
class T>
137 template <
class Key,
class T>
139 {
while (
f) {
delete f->
t;
f =
f->
n; }
142 template <
class Key,
class T>
146 template <
class Key,
class T>
150 template <
class Key,
class T>
154 template <
class Key,
class T>
166 template <
class Key,
class T>
180 template <
class Key,
class T>
189 Node sn(aobject, acost);
193 n->keyPtr = &i.
key();
201 template <
class Key,
class T>
205 while (n &&
total > m) {
The QHash::const_iterator class provides an STL-style const iterator for QHash and QMultiHash...
T * object(const Key &key) const
#define QT_END_NAMESPACE
This macro expands to.
int remove(const Key &key)
Removes all the items that have the key from the hash.
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
T & value() const
Returns a modifiable reference to the current item's value.
The QHash class is a template class that provides a hash-table-based dictionary.
bool contains(const Key &key) const
Returns true if the hash contains an item with the key; otherwise returns false.
#define QT_BEGIN_NAMESPACE
This macro expands to.
bool isEmpty() const
Returns true if the hash contains no items; otherwise returns false.
static const char * data(const QByteArray &arr)
const Key & key() const
Returns the current item's key as a const reference.
bool insert(const Key &key, T *object, int cost=1)
bool contains(const Key &key) const
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash...
int size() const
Returns the number of items in the hash.
The QHash::iterator class provides an STL-style non-const iterator for QHash and QMultiHash.
QList< Key > keys() const
iterator find(const Key &key)
Returns an iterator pointing to the item with the key in the hash.
QList< Key > keys() const
Returns a list containing all the keys in the hash, in an arbitrary order.
T * relink(const Key &key)
bool remove(const Key &key)
The QList class is a template class that provides lists.
T * operator[](const Key &key) const