summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qhash.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-12-03 11:16:18 +0100
committerMårten Nordheim <marten.nordheim@qt.io>2019-12-05 11:50:32 +0100
commit7b34da9ef12554025bb4a8f4750e5807cc37f38c (patch)
treea334544ede1f1946585300b60a50d242fffdf022 /src/corelib/tools/qhash.cpp
parent3359b29c99581f52acf033489ad35884a01ccac8 (diff)
Add QHash::insert(const QHash &other)
As opposed to unite(), this inserts one hash into the other without duplicating elements. Change-Id: Ifc786c48f5dc3ab18c29782e73eac3c1a3ef8981 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/tools/qhash.cpp')
-rw-r--r--src/corelib/tools/qhash.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp
index a53d6db997..dcac91778f 100644
--- a/src/corelib/tools/qhash.cpp
+++ b/src/corelib/tools/qhash.cpp
@@ -1807,6 +1807,18 @@ uint qHash(long double key, uint seed) noexcept
\sa insertMulti()
*/
+/*! \fn template <class Key, class T> void QHash<Key, T>::insert(const QHash &other)
+ \since 5.15
+
+ Inserts all the items in the \a other hash into this hash.
+
+ If a key is common to both hashes, its value will be replaced with the
+ value stored in \a other.
+
+ \note If \a other contains multiple entries with the same key then the
+ final value of the key is undefined.
+*/
+
/*! \fn template <class Key, class T> QHash<Key, T>::iterator QHash<Key, T>::insertMulti(const Key &key, const T &value)
Inserts a new item with the \a key and a value of \a value.