![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <QtCore/qstring.h>#include <QtCore/qstringfwd.h>#include <QtCore/qbitarray.h>#include <numeric>#include <functional>#include <optional>Go to the source code of this file.
Namespaces | |
| namespace | QHashPrivate |
| namespace | QHashPrivate::detail |
| namespace | QtPrivate |
Macros | |
| #define | QT_MK_QHASH_COMPAT(X) |
| #define | QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH(Class, Arguments) |
| #define | QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH_BY_CREF(Class) |
| #define | QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH_BY_VALUE(Class) |
Typedefs | |
| template<typename Key, typename T> | |
| using | QHashPrivate::HeterogeneouslySearchableWith |
| template<typename Key, typename K> | |
| using | QHashPrivate::if_heterogeneously_searchable_with |
| template<typename Mixer> | |
| using | QtPrivate::QHashCombiner = QHashCombinerWithSeed<Mixer> |
| using | QtPrivate::QHashCombine = QHashCombiner<QHashCombineMixer> |
| using | QtPrivate::QHashCombineWithSeed = QHashCombinerWithSeed<QHashCombineMixer> |
| using | QtPrivate::QHashCombineCommutative = QHashCombiner<QHashCombineCommutativeMixer> |
| using | QtPrivate::QHashCombineCommutativeWithSeed = QHashCombinerWithSeed<QHashCombineCommutativeMixer> |
| template<typename... T> | |
| using | QtPrivate::QHashMultiReturnType |
Functions | |
| Q_DECL_CONST_FUNCTION constexpr size_t | QHashPrivate::hash (size_t key, size_t seed) noexcept |
| template<typename T1, typename T2> | |
| constexpr bool | QHashPrivate::noexceptPairHash () |
| Q_CORE_EXPORT Q_DECL_PURE_FUNCTION size_t | qHashBits (const void *p, size_t size, size_t seed=0) noexcept |
| template<typename T1, typename T2> | |
| size_t | qHash (const std::pair< T1, T2 > &key, size_t seed=0) noexcept(QHashPrivate::noexceptPairHash< T1, T2 >()) |
| constexpr size_t | qHash (std::nullopt_t, size_t seed=0) noexcept |
| template<typename T> | |
| constexpr size_t | qHash (const std::optional< T > &key, size_t seed=0) noexcept(QHashPrivate::noexceptPairHash< T, T >()) |
| Q_DECL_CONST_FUNCTION constexpr size_t | qHash (char key, size_t seed=0) noexcept |
| Q_DECL_CONST_FUNCTION constexpr size_t | qHash (uchar key, size_t seed=0) noexcept |
| Q_DECL_CONST_FUNCTION constexpr size_t | qHash (signed char key, size_t seed=0) noexcept |
| Q_DECL_CONST_FUNCTION constexpr size_t | qHash (ushort key, size_t seed=0) noexcept |
| Q_DECL_CONST_FUNCTION constexpr size_t | qHash (short key, size_t seed=0) noexcept |
| Q_DECL_CONST_FUNCTION constexpr size_t | qHash (uint key, size_t seed=0) noexcept |
| Q_DECL_CONST_FUNCTION constexpr size_t | qHash (int key, size_t seed=0) noexcept |
| Q_DECL_CONST_FUNCTION constexpr size_t | qHash (ulong key, size_t seed=0) noexcept |
| Q_DECL_CONST_FUNCTION constexpr size_t | qHash (long key, size_t seed=0) noexcept |
| Q_DECL_CONST_FUNCTION constexpr size_t | qHash (quint64 key, size_t seed=0) noexcept |
| Q_DECL_CONST_FUNCTION constexpr size_t | qHash (qint64 key, size_t seed=0) noexcept |
| Q_DECL_CONST_FUNCTION size_t | qHash (float key, size_t seed=0) noexcept |
| Q_CORE_EXPORT Q_DECL_CONST_FUNCTION size_t | qHash (double key, size_t seed=0) noexcept |
| Q_CORE_EXPORT Q_DECL_CONST_FUNCTION size_t | qHash (long double key, size_t seed=0) noexcept |
| Q_DECL_CONST_FUNCTION constexpr size_t | qHash (wchar_t key, size_t seed=0) noexcept |
| Q_DECL_CONST_FUNCTION constexpr size_t | qHash (char16_t key, size_t seed=0) noexcept |
| Q_DECL_CONST_FUNCTION constexpr size_t | qHash (char32_t key, size_t seed=0) noexcept |
| template<class T> | |
| size_t | qHash (const T *key, size_t seed=0) noexcept |
| Q_DECL_CONST_FUNCTION constexpr size_t | qHash (std::nullptr_t, size_t seed=0) noexcept |
| template<class Enum, std::enable_if_t< std::is_enum_v< Enum >, bool > = true> | |
| Q_DECL_CONST_FUNCTION constexpr size_t | qHash (Enum e, size_t seed=0) noexcept |
| Q_DECL_CONST_FUNCTION constexpr size_t | qHash (const QChar key, size_t seed=0) noexcept |
| Q_CORE_EXPORT Q_DECL_PURE_FUNCTION size_t | qHash (QByteArrayView key, size_t seed=0) noexcept |
| Q_DECL_PURE_FUNCTION size_t | qHash (const QByteArray &key, size_t seed=0 QT6_DECL_NEW_OVERLOAD_TAIL) noexcept |
| Q_CORE_EXPORT Q_DECL_PURE_FUNCTION size_t | qHash (QStringView key, size_t seed=0) noexcept |
| Q_DECL_PURE_FUNCTION size_t | qHash (const QString &key, size_t seed=0) noexcept |
| Q_CORE_EXPORT Q_DECL_PURE_FUNCTION size_t | qHash (const QBitArray &key, size_t seed=0) |
| Q_CORE_EXPORT Q_DECL_PURE_FUNCTION size_t | qHash (QLatin1StringView key, size_t seed=0) noexcept |
| Q_DECL_CONST_FUNCTION constexpr size_t | qHash (QKeyCombination key, size_t seed=0) noexcept |
| Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint | qt_hash (QStringView key, uint chained=0) noexcept |
| template<typename Enum> | |
| Q_DECL_CONST_FUNCTION constexpr size_t | qHash (QFlags< Enum > flags, size_t seed=0) noexcept |
| template<typename T> | |
| constexpr size_t | QHashPrivate::ex1to2arg (const T &key, size_t seed) |
| template<typename T> | |
| bool | qHashEquals (const T &a, const T &b) |
| template<typename T1, typename T2, QHashPrivate::if_heterogeneously_searchable_with< T1, T2 > = true> | |
| bool | qHashEquals (const T1 &a, const T2 &b) |
| template<typename... T> | |
| constexpr QtPrivate::QHashMultiReturnType< T... > | qHashMulti (size_t seed, const T &... args) noexcept(std::conjunction_v< QtPrivate::QNothrowHashable< T >... >) |
| template<typename... T> | |
| constexpr QtPrivate::QHashMultiReturnType< T... > | qHashMultiCommutative (size_t seed, const T &... args) noexcept(std::conjunction_v< QtPrivate::QNothrowHashable< T >... >) |
| template<typename InputIterator> | |
| size_t | qHashRange (InputIterator first, InputIterator last, size_t seed=0) noexcept(noexcept(qHash(*first, 0))) |
| template<typename InputIterator> | |
| size_t | qHashRangeCommutative (InputIterator first, InputIterator last, size_t seed=0) noexcept(noexcept(qHash(*first, 0))) |
Variables | |
| template<typename T> | |
| constexpr bool | QtPrivate::QNothrowHashableHelper_v = noexcept(qHash(std::declval<const T &>(), size_t(0))) |
| template<typename T> | |
| constexpr bool | QtPrivate::QNothrowHashable_v = QNothrowHashable<T>::value |
| #define QT_MK_QHASH_COMPAT | ( | X | ) |
Definition at line 103 of file qhashfunctions.h.
| #define QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH | ( | Class, | |
| Arguments ) |
Definition at line 484 of file qhashfunctions.h.
| #define QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH_BY_CREF | ( | Class | ) |
Definition at line 507 of file qhashfunctions.h.
| #define QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH_BY_VALUE | ( | Class | ) |
Definition at line 509 of file qhashfunctions.h.
|
inlineconstexprnoexcept |
Definition at line 110 of file qhashfunctions.h.
|
inlineconstexprnoexcept |
Definition at line 180 of file qhashfunctions.h.
|
inlineconstexprnoexcept |
Definition at line 182 of file qhashfunctions.h.
|
noexcept |
|
inlinenoexcept |
Definition at line 217 of file qhashfunctions.h.
|
inlineconstexprnoexcept |
Definition at line 210 of file qhashfunctions.h.
|
inlinenoexcept |
Definition at line 223 of file qhashfunctions.h.
|
constexprnoexcept |
This is equivalent to
In particular, if key is engaged ({has_value()}), the hash value of key is guaranteed to be the same as that of {key.value()}, and all disengaged ({!has_value()}) optionals, of any type, hash to the same value.
Definition at line 472 of file qhashfunctions.h.
|
inlinenoexcept |
Definition at line 478 of file qhashfunctions.h.
|
inlinenoexcept |
Definition at line 188 of file qhashfunctions.h.
|
noexcept |
|
inlineconstexprnoexcept |
Definition at line 206 of file qhashfunctions.h.
|
inlinenoexcept |
Definition at line 168 of file qhashfunctions.h.
|
inlineconstexprnoexcept |
Definition at line 122 of file qhashfunctions.h.
|
noexcept |
|
inlineconstexprnoexcept |
Definition at line 126 of file qhashfunctions.h.
|
noexcept |
|
inlineconstexprnoexcept |
Definition at line 234 of file qhashfunctions.h.
|
inlineconstexprnoexcept |
Definition at line 135 of file qhashfunctions.h.
|
inlineconstexprnoexcept |
Definition at line 229 of file qhashfunctions.h.
|
noexcept |
|
noexcept |
|
inlineconstexprnoexcept |
Definition at line 129 of file qhashfunctions.h.
|
inlineconstexprnoexcept |
Definition at line 118 of file qhashfunctions.h.
|
inlineconstexprnoexcept |
Definition at line 114 of file qhashfunctions.h.
|
constexprnoexcept |
Definition at line 462 of file qhashfunctions.h.
|
inlineconstexprnoexcept |
Definition at line 201 of file qhashfunctions.h.
|
inlineconstexprnoexcept |
Definition at line 112 of file qhashfunctions.h.
|
inlineconstexprnoexcept |
Definition at line 120 of file qhashfunctions.h.
|
inlineconstexprnoexcept |
Definition at line 124 of file qhashfunctions.h.
|
inlineconstexprnoexcept |
Definition at line 116 of file qhashfunctions.h.
|
inlineconstexprnoexcept |
Definition at line 178 of file qhashfunctions.h.
|
|
Definition at line 315 of file qhashfunctions.h.
| bool qHashEquals | ( | const T1 & | a, |
| const T2 & | b ) |
Definition at line 321 of file qhashfunctions.h.
|
Definition at line 419 of file qhashfunctions.h.
|
Definition at line 433 of file qhashfunctions.h.
|
Definition at line 441 of file qhashfunctions.h.
|
Definition at line 448 of file qhashfunctions.h.
|
noexcept |
Private copy of the implementation of the Qt 4 qHash algorithm for strings, (that is, QChar-based arrays, so all QString-like classes), to be used wherever the result is somehow stored or reused across multiple Qt versions. The public qHash implementation can change at any time, therefore one must not rely on the fact that it will always give the same results.
The qt_hash functions must never change their results.
This function can hash discontiguous memory by invoking it on each chunk, passing the previous's result in the next call's chained argument.