diff options
author | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2018-09-03 14:02:13 +0200 |
---|---|---|
committer | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2018-10-15 10:55:18 +0000 |
commit | 1f6bfc220774e9407fe88916843b76ed103cff72 (patch) | |
tree | 8d6157d5b974e6045d75a716f8eb0db4daefa35f /src/corelib/tools/qhash.cpp | |
parent | 02a214442781bf112c1cc85d2470c6fcec8ed207 (diff) |
Doc: Move literal code block to a separate file
We need to override this snippet for the documentation
we generate for Qt for Python, and it is easier to have
it on a separate file.
Task-number: PYSIDE-801
Task-number: PYSIDE-691
Change-Id: Ideb5b6af25024279f167137d3b65660bb9c96a7e
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/corelib/tools/qhash.cpp')
-rw-r--r-- | src/corelib/tools/qhash.cpp | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp index 8d2616865e..32e9a4269c 100644 --- a/src/corelib/tools/qhash.cpp +++ b/src/corelib/tools/qhash.cpp @@ -755,9 +755,7 @@ void QHashData::checkSanity() Types \c T1 and \c T2 must be supported by qHash(). \note The return type of this function is \e{not} the same as that of - \code - qHash(qMakePair(key.first, key.second), seed); - \endcode + \snippet code/src_corelib_tools_qhash.cpp 29 The two functions use different hashing algorithms; due to binary compatibility constraints, we cannot change the QPair algorithm to match the std::pair one before Qt 6. */ @@ -773,14 +771,10 @@ void QHashData::checkSanity() The return value of this function depends on the order of elements in the range. That means that - \code - {0, 1, 2} - \endcode + \snippet code/src_corelib_tools_qhash.cpp 30 and - \code - {1, 2, 0} - \endcode + \snippet code/src_corelib_tools_qhash.cpp 31 hash to \b{different} values. If order does not matter, for example for hash tables, use qHashRangeCommutative() instead. If you are hashing raw @@ -812,14 +806,10 @@ void QHashData::checkSanity() The return value of this function does not depend on the order of elements in the range. That means that - \code - {0, 1, 2} - \endcode + \snippet code/src_corelib_tools_qhash.cpp 30 and - \code - {1, 2, 0} - \endcode + \snippet code/src_corelib_tools_qhash.cpp 31 hash to the \b{same} values. If order matters, for example, for vectors and arrays, use qHashRange() instead. If you are hashing raw @@ -1177,13 +1167,7 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW For a key type \c{K}, the qHash function must have one of these signatures: - \code - uint qHash(K key); - uint qHash(const K &key); - - uint qHash(K key, uint seed); - uint qHash(const K &key, uint seed); - \endcode + \snippet code/src_corelib_tools_qhash.cpp 32 The two-arguments overloads take an unsigned integer that should be used to seed the calculation of the hash function. This seed is provided by QHash |