Obsolete Members for QHash

The following members of class QHash are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.

Public Functions

(obsolete) QHash::iterator insertMulti(const Key &key, const T &value)
(obsolete) QList<Key> uniqueKeys() const
(obsolete) QHash<K, V> &unite(const QHash<K, V> &other)
(obsolete) QList<T> values(const Key &key) const

Member Function Documentation

QHash::iterator QHash::insertMulti(const Key &key, const T &value)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Inserts a new item with the key and a value of value.

If there is already an item with the same key in the hash, this function will simply create a new one. (This behavior is different from insert(), which overwrites the value of an existing item.)

This function is obsolete. Use QMultiHash or QMultiMap instead.

See also insert() and values().

QList<Key> QHash::uniqueKeys() const

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Use QMultiHash for storing multiple values with the same key.

Returns a list containing all the keys in the map. Keys that occur multiple times in the map (because items were inserted with insertMulti(), or unite() was used) occur only once in the returned list.

This function was introduced in Qt 4.2.

See also QMultiHash::uniqueKeys().

QHash<K, V> &QHash::unite(const QHash<K, V> &other)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Inserts all the items in the other hash into this hash. If a key is common to both hashes, the resulting hash will contain the key multiple times.

QList<T> QHash::values(const Key &key) const

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This is an overloaded function.

Use QMultiHash for storing multiple values with the same key.

Returns a list of all the values associated with the key, from the most recently inserted to the least recently inserted.

See also count() and insertMulti().

© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.