diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-10-26 09:30:49 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-11-03 16:28:14 +0100 |
commit | f8c30759d98603908b408464ea6d98413fc81eec (patch) | |
tree | ed1f7828c517d9ebafb401fe8955eee45fdc44f1 /src/corelib/tools/qhash.cpp | |
parent | a9c52dbdf47a6a070b84c8d34ae3c0c29a8ac1e8 (diff) |
Make the QMultiHash(const QHash &) constructor explicit
And add a QMultiHash::unite(const QHash &) method to avoid
a copy of the data when inserting a QHash into a multi hash.
Change-Id: I864aa9d2b9b7b2c367c3c4d140a2ce2f5408ae09
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qhash.cpp')
-rw-r--r-- | src/corelib/tools/qhash.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp index 9ca49f13eb..112a492526 100644 --- a/src/corelib/tools/qhash.cpp +++ b/src/corelib/tools/qhash.cpp @@ -2538,6 +2538,16 @@ size_t qHash(long double key, size_t seed) noexcept \sa insert() */ + +/*! \fn template <class Key, class T> QMultiHash &QMultiHash<Key, T>::unite(const QHash<Key, T> &other) + \since 6.0 + + Inserts all the items in the \a other hash into this hash + and returns a reference to this hash. + + \sa insert() +*/ + /*! \fn template <class Key, class T> QList<Key> QMultiHash<Key, T>::uniqueKeys() const \since 5.13 |