Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\inmodule QtCore More...
#include <qhash.h>
Classes | |
class | const_iterator |
\inmodule QtCore More... | |
class | iterator |
\inmodule QtCore More... | |
class | key_iterator |
\inmodule QtCore More... | |
Public Types | |
using | key_type = Key |
Typedef for Key. | |
using | mapped_type = T |
Typedef for T. | |
using | value_type = T |
using | size_type = qsizetype |
Typedef for int. | |
using | difference_type = qsizetype |
Typedef for ptrdiff_t. | |
using | reference = T & |
using | const_reference = const T & |
typedef QKeyValueIterator< const Key &, const T &, const_iterator > | const_key_value_iterator |
\inmodule QtCore | |
typedef QKeyValueIterator< const Key &, T &, iterator > | key_value_iterator |
\inmodule QtCore | |
typedef iterator | Iterator |
Qt-style synonym for QHash::iterator. | |
typedef const_iterator | ConstIterator |
Qt-style synonym for QHash::const_iterator. | |
Public Member Functions | |
QHash () noexcept=default | |
Constructs an empty hash. | |
QHash (std::initializer_list< std::pair< Key, T > > list) | |
QHash (const QHash &other) noexcept | |
Constructs a copy of other. | |
~QHash () | |
Destroys the hash. | |
QHash & | operator= (const QHash &other) noexcept(std::is_nothrow_destructible< Node >::value) |
Assigns other to this hash and returns a reference to this hash. | |
QHash (QHash &&other) noexcept | |
Move-constructs a QHash instance, making it point at the same object that other was pointing to. | |
template<typename InputIterator , QtPrivate::IfAssociativeIteratorHasKeyAndValue< InputIterator > = true> | |
QHash (InputIterator f, InputIterator l) | |
template<typename InputIterator , QtPrivate::IfAssociativeIteratorHasFirstAndSecond< InputIterator > = true> | |
QHash (InputIterator f, InputIterator l) | |
void | swap (QHash &other) noexcept |
template<typename Predicate > | |
qsizetype | removeIf (Predicate pred) |
T | take (const Key &key) |
Removes the item with the key from the hash and returns the value associated with it. | |
bool | contains (const Key &key) const noexcept |
Returns true if the hash contains an item with the key; otherwise returns false . | |
qsizetype | count (const Key &key) const noexcept |
Returns the number of items associated with the key. | |
Key | key (const T &value) const noexcept |
Key | key (const T &value, const Key &defaultKey) const noexcept |
T | value (const Key &key) const noexcept |
T | value (const Key &key, const T &defaultValue) const noexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns the value associated with the key. | |
T & | operator[] (const Key &key) |
Returns the value associated with the key as a modifiable reference. | |
const T | operator[] (const Key &key) const noexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Same as value(). | |
QList< Key > | keys () const |
Returns a list containing all the keys in the hash, in an arbitrary order. | |
QList< Key > | keys (const T &value) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a list containing all the keys associated with value value, in an arbitrary order. | |
QList< T > | values () const |
Returns a list containing all the values in the hash, in an arbitrary order. | |
iterator | begin () |
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash. | |
const_iterator | begin () const noexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
const_iterator | cbegin () const noexcept |
const_iterator | constBegin () const noexcept |
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash. | |
iterator | end () noexcept |
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last item in the hash. | |
const_iterator | end () const noexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
const_iterator | cend () const noexcept |
const_iterator | constEnd () const noexcept |
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last item in the hash. | |
key_iterator | keyBegin () const noexcept |
key_iterator | keyEnd () const noexcept |
key_value_iterator | keyValueBegin () |
key_value_iterator | keyValueEnd () |
const_key_value_iterator | keyValueBegin () const noexcept |
const_key_value_iterator | constKeyValueBegin () const noexcept |
const_key_value_iterator | keyValueEnd () const noexcept |
const_key_value_iterator | constKeyValueEnd () const noexcept |
auto | asKeyValueRange () & |
auto | asKeyValueRange () const & |
auto | asKeyValueRange () && |
auto | asKeyValueRange () const && |
iterator | erase (const_iterator it) |
std::pair< iterator, iterator > | equal_range (const Key &key) |
std::pair< const_iterator, const_iterator > | equal_range (const Key &key) const noexcept |
qsizetype | count () const noexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Same as size(). | |
iterator | find (const Key &key) |
Returns an iterator pointing to the item with the key in the hash. | |
const_iterator | find (const Key &key) const noexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
const_iterator | constFind (const Key &key) const noexcept |
iterator | insert (const Key &key, const T &value) |
Inserts a new item with the key and a value of value. | |
void | insert (const QHash &hash) |
template<typename ... Args> | |
iterator | emplace (const Key &key, Args &&... args) |
template<typename ... Args> | |
iterator | emplace (Key &&key, Args &&... args) |
Inserts a new element into the container. | |
float | load_factor () const noexcept |
Returns the current load factor of the QHash's internal hash table. | |
size_t | bucket_count () const noexcept |
bool | empty () const noexcept |
This function is provided for STL compatibility. | |
template<typename K , if_heterogeneously_searchable< K > = true> | |
bool | remove (const K &key) |
template<typename K , if_heterogeneously_searchable< K > = true> | |
T | take (const K &key) |
template<typename K , if_heterogeneously_searchable< K > = true> | |
bool | contains (const K &key) const |
template<typename K , if_heterogeneously_searchable< K > = true> | |
qsizetype | count (const K &key) const |
template<typename K , if_heterogeneously_searchable< K > = true> | |
T | value (const K &key) const noexcept |
template<typename K , if_heterogeneously_searchable< K > = true> | |
T | value (const K &key, const T &defaultValue) const noexcept |
template<typename K , if_heterogeneously_searchable< K > = true, if_key_constructible_from< K > = true> | |
T & | operator[] (const K &key) |
template<typename K , if_heterogeneously_searchable< K > = true> | |
const T | operator[] (const K &key) const noexcept |
template<typename K , if_heterogeneously_searchable< K > = true> | |
std::pair< iterator, iterator > | equal_range (const K &key) |
template<typename K , if_heterogeneously_searchable< K > = true> | |
std::pair< const_iterator, const_iterator > | equal_range (const K &key) const noexcept |
template<typename K , if_heterogeneously_searchable< K > = true> | |
iterator | find (const K &key) |
template<typename K , if_heterogeneously_searchable< K > = true> | |
const_iterator | find (const K &key) const noexcept |
template<typename K , if_heterogeneously_searchable< K > = true> | |
const_iterator | constFind (const K &key) const noexcept |
Static Public Member Functions | |
static float | max_load_factor () noexcept |
static size_t | max_bucket_count () noexcept |
Friends | |
class | QSet< Key > |
class | QMultiHash< Key, T > |
class | iterator |
class | const_iterator |
template<typename AKey = Key, typename AT = T, QTypeTraits::compare_eq_result_container< QHash, AKey, AT > = true> | |
bool | comparesEqual (const QHash &lhs, const QHash &rhs) noexcept |
Related Symbols | |
(Note that these are not member symbols.) | |
size_t | qHash (const QUrl &url, size_t seed) noexcept |
Returns the hash value for the url. | |
size_t | qHash (const QDateTime &key, size_t seed=0) |
size_t | qHash (QDate key, size_t seed=0) |
size_t | qHash (QTime key, size_t seed=0) |
template< typename T1, typename T2 > size_t | qHash (const std::pair< T1, T2 > &key, size_t seed=0) |
template< typename... T > size_t | qHashMulti (size_t seed, const T &...args) |
template< typename... T > size_t | qHashMultiCommutative (size_t seed, const T &...args) |
template< typename InputIterator > size_t | qHashRange (InputIterator first, InputIterator last, size_t seed=0) |
template< typename InputIterator > size_t | qHashRangeCommutative (InputIterator first, InputIterator last, size_t seed=0) |
size_t | qHashBits (const void *p, size_t len, size_t seed=0) |
template< typname T, std::enable_if_t< std::is_same_v< T, bool >, bool >=true > size_t | qHash (T key, size_t seed) |
size_t | qHash (char key, size_t seed=0) |
size_t | qHash (uchar key, size_t seed=0) |
size_t | qHash (signed char key, size_t seed=0) |
size_t | qHash (ushort key, size_t seed=0) |
size_t | qHash (short key, size_t seed=0) |
size_t | qHash (uint key, size_t seed=0) |
size_t | qHash (int key, size_t seed=0) |
size_t | qHash (ulong key, size_t seed=0) |
size_t | qHash (long key, size_t seed=0) |
size_t | qHash (quint64 key, size_t seed=0) |
size_t | qHash (qint64 key, size_t seed=0) |
size_t | qHash (quint128 key, size_t seed=0) |
size_t | qHash (qint128 key, size_t seed=0) |
size_t | qHash (char8_t key, size_t seed=0) |
size_t | qHash (char16_t key, size_t seed=0) |
size_t | qHash (char32_t key, size_t seed=0) |
size_t | qHash (wchar_t key, size_t seed=0) |
size_t | qHash (float key, size_t seed=0) noexcept |
size_t | qHash (double key, size_t seed) noexcept |
size_t | qHash (long double key, size_t seed) noexcept |
size_t | qHash (const QChar key, size_t seed=0) |
size_t | qHash (const QByteArray &key, size_t seed=0) |
size_t | qHash (const QByteArrayView &key, size_t seed=0) |
size_t | qHash (const QBitArray &key, size_t seed=0) |
size_t | qHash (const QString &key, size_t seed=0) |
size_t | qHash (QLatin1StringView key, size_t seed=0) |
template< class T > size_t | qHash (const T *key, size_t seed=0) |
size_t | qHash (std::nullptr_t key, size_t seed=0) |
template< typename T > bool | qHashEquals (const T &a, const T &b) |
template< class Key, class T > QDataStream & | operator<< (QDataStream &out, const QHash< Key, T > &hash) |
Writes the hash hash to stream out. | |
template< class Key, class T > QDataStream & | operator>> (QDataStream &in, QHash< Key, T > &hash) |
Reads a hash from stream in into hash. | |
template< class Key, class T > size_t | qHash (const QHash< Key, T > &key, size_t seed=0) |
template< typename Key, typename T, typename Predicate > qsizetype | erase_if (QHash< Key, T > &hash, Predicate pred) |
size_t | qHash (QPoint key, size_t seed=0) |
size_t | qHash (const QTypeRevision &key, size_t seed) |
size_t | qHash (const QVersionNumber &key, size_t seed) |
size_t | qHash (const QOcspResponse &response, size_t seed) noexcept |
Returns the hash value for the response, using seed to seed the calculation. | |
size_t | qHash (const QSslCertificate &key, size_t seed) noexcept |
Returns the hash value for the key, using seed to seed the calculation. | |
size_t | qHash (QSslEllipticCurve curve, size_t seed=0) |
size_t | qHash (const QSslError &key, size_t seed) noexcept |
Returns the hash value for the key, using seed to seed the calculation. | |
size_t | qHash (const QGeoCoordinate &coordinate, size_t seed=0) |
Returns a hash value for coordinate, using seed to seed the calculation. | |
\inmodule QtCore
The QHash class is a template class that provides a hash-table-based dictionary. \compares equality
\reentrant
QHash<Key, T> is one of Qt's generic \l{container classes}. It stores (key, value) pairs and provides very fast lookup of the value associated with a key.
QHash provides very similar functionality to QMap. The differences are:
\list
Here's an example QHash with QString keys and int
values:
To insert a (key, value) pair into the hash, you can use operator[]():
This inserts the following three (key, value) pairs into the QHash: ("one", 1), ("three", 3), and ("seven", 7). Another way to insert items into the hash is to use insert():
To look up a value, use operator[]() or value():
If there is no item with the specified key in the hash, these functions return a \l{default-constructed value}.
If you want to check whether the hash contains a particular key, use contains():
There is also a value() overload that uses its second argument as a default value if there is no item with the specified key:
In general, we recommend that you use contains() and value() rather than operator[]() for looking up a key in a hash. The reason is that operator[]() silently inserts an item into the hash if no item exists with the same key (unless the hash is const). For example, the following code snippet will create 1000 items in memory:
To avoid this problem, replace hash
[i] with hash.value(i)
in the code above.
Internally, QHash uses a hash table to perform lookups. This hash table automatically grows to provide fast lookups without wasting too much memory. You can still control the size of the hash table by calling reserve() if you already know approximately how many items the QHash will contain, but this isn't necessary to obtain good performance. You can also call capacity() to retrieve the hash table's size.
QHash will not shrink automatically if items are removed from the table. To minimize the memory used by the hash, call squeeze().
If you want to navigate through all the (key, value) pairs stored in a QHash, you can use an iterator. QHash provides both \l{Java-style iterators} (QHashIterator and QMutableHashIterator) and \l{STL-style iterators} (QHash::const_iterator and QHash::iterator). Here's how to iterate over a QHash<QString, int> using a Java-style iterator:
Here's the same code, but using an STL-style iterator:
QHash is unordered, so an iterator's sequence cannot be assumed to be predictable. If ordering by key is required, use a QMap.
A QHash allows only one value per key. If you call insert() with a key that already exists in the QHash, the previous value is erased. For example:
If you need to store multiple entries for the same key in the hash table, use \l{QMultiHash}.
If you only need to extract the values from a hash (not the keys), you can also use range-based for:
Items can be removed from the hash in several ways. One way is to call remove(); this will remove any item with the given key. Another way is to use QMutableHashIterator::remove(). In addition, you can clear the entire hash using clear().
QHash's key and value data types must be \l{assignable data types}. You cannot, for example, store a QWidget as a value; instead, store a QWidget *.
\target qHash
QKeyValueIterator<const Key&, const T&, const_iterator> QHash< Key, T >::const_key_value_iterator |
\inmodule QtCore
The QHash::const_key_value_iterator typedef provides an STL-style const iterator for QHash.
QHash::const_key_value_iterator is essentially the same as QHash::const_iterator with the difference that operator*() returns a key/value pair instead of a value.
const_iterator QHash< Key, T >::ConstIterator |
Qt-style synonym for QHash::const_iterator.
Qt-style synonym for QHash::iterator.
QKeyValueIterator<const Key&, T&, iterator> QHash< Key, T >::key_value_iterator |
\inmodule QtCore
The QHash::key_value_iterator typedef provides an STL-style iterator for QHash.
QHash::key_value_iterator is essentially the same as QHash::iterator with the difference that operator*() returns a key/value pair instead of a value.
using QHash< Key, T >::reference = T & |
Constructs an empty hash.
|
inline |
Constructs a hash with a copy of each of the elements in the initializer list list.
Definition at line 840 of file qhash.h.
References QHash< Key, T >::insert().
|
inlinenoexcept |
Constructs a copy of other.
This operation occurs in \l{constant time}, because QHash is \l{implicitly shared}. This makes returning a QHash from a function very fast. If a shared instance is modified, it will be copied (copy-on-write), and this takes \l{linear time}.
|
inlinenoexcept |
Move-constructs a QHash instance, making it point at the same object that other was pointing to.
Definition at line 874 of file qhash.h.
References QHash< Key, T >::QHash().
Referenced by QHash< Key, T >::QHash().
|
inline |
Constructs a hash with a copy of each of the elements in the iterator range [begin, end). Either the elements iterated by the range must be objects with {first} and
{second} data members (like
{std::pair}), convertible to
Key
and to T
respectively; or the iterators must have {key()} and
{value()} member functions, returning a key convertible to
Key
and a value convertible to T
respectively.
|
inline |
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash.
qhash-iterator-invalidation-func-desc
|
inlinenoexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
qhash-iterator-invalidation-func-desc
Definition at line 1238 of file qhash.h.
Referenced by QHash< Key, T >::constKeyValueBegin(), QHash< Key, T >::keyBegin(), QHash< Key, T >::keyValueBegin(), and QHash< Key, T >::keyValueBegin().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash.
qhash-iterator-invalidation-func-desc
|
inlinenoexcept |
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last item in the hash.
qhash-iterator-invalidation-func-desc
Definition at line 1244 of file qhash.h.
Referenced by QHash< Key, T >::erase().
|
inlinenoexcept |
|
inlinenoexcept |
Returns an iterator pointing to the item with the key in the hash.
If the hash contains no item with the key, the function returns constEnd().
qhash-iterator-invalidation-func-desc
|
inlinenoexcept |
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first entry in the hash.
qhash-iterator-invalidation-func-desc
Definition at line 1250 of file qhash.h.
References QHash< Key, T >::begin().
|
inlinenoexcept |
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary entry after the last entry in the hash.
qhash-iterator-invalidation-func-desc
Definition at line 1252 of file qhash.h.
References QHash< Key, T >::end().
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Same as size().
|
inlinenoexcept |
Returns the number of items associated with the key.
|
inlinenoexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
qhash-iterator-invalidation-func-desc
Definition at line 1242 of file qhash.h.
Referenced by QHash< Key, T >::constKeyValueEnd(), QHash< Key, T >::keyEnd(), QHash< Key, T >::keyValueEnd(), and QHash< Key, T >::keyValueEnd().
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last item in the hash.
qhash-iterator-invalidation-func-desc
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Removes the (key, value) pair associated with the iterator pos from the hash, and returns an iterator to the next item in the hash.
This function never causes QHash to rehash its internal data structure. This means that it can safely be called while iterating, and won't affect the order of items in the hash. For example:
qhash-iterator-invalidation-func-desc
Definition at line 1258 of file qhash.h.
References QHash< Key, T >::constEnd().
|
inlinenoexcept |
Returns an iterator pointing to the item with the key in the hash.
If the hash contains no item with the key, the function returns end().
If the hash contains multiple items with the key, this function returns an iterator that points to the most recently inserted value. The other values are accessible by incrementing the iterator. For example, here's some code that iterates over all the items with the same key:
qhash-iterator-invalidation-func-desc
|
inlinenoexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
qhash-iterator-invalidation-func-desc
|
inline |
Inserts all the items in the other hash into this hash.
If a key is common to both hashes, its value will be replaced with the value stored in other.
Definition at line 1333 of file qhash.h.
Referenced by QHash< Key, T >::QHash().
|
inlinenoexcept |
Returns the first key mapped to value. If the hash contains no item mapped to value, returns defaultKey, or a \l{default-constructed value}{default-constructed key} if this parameter has not been supplied.
This function can be slow (\l{linear time}), because QHash's internal data structure is optimized for fast lookup by key, not by value.
|
inlinenoexcept |
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first key in the hash.
qhash-iterator-invalidation-func-desc
Definition at line 1245 of file qhash.h.
References QHash< Key, T >::begin().
|
inlinenoexcept |
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last key in the hash.
qhash-iterator-invalidation-func-desc
Definition at line 1246 of file qhash.h.
References QHash< Key, T >::end().
Returns a list containing all the keys in the hash, in an arbitrary order.
The order is guaranteed to be the same as that used by values().
This function creates a new list, in \l {linear time}. The time and memory use that entails can be avoided by iterating from \l keyBegin() to \l keyEnd().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a list containing all the keys associated with value value, in an arbitrary order.
This function can be slow (\l{linear time}), because QHash's internal data structure is optimized for fast lookup by key, not by value.
|
inline |
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first entry in the hash.
qhash-iterator-invalidation-func-desc
Definition at line 1247 of file qhash.h.
References QHash< Key, T >::begin().
|
inlinenoexcept |
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first entry in the hash.
qhash-iterator-invalidation-func-desc
Definition at line 1249 of file qhash.h.
References QHash< Key, T >::begin().
|
inline |
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary entry after the last entry in the hash.
qhash-iterator-invalidation-func-desc
Definition at line 1248 of file qhash.h.
References QHash< Key, T >::end().
|
inlinenoexcept |
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary entry after the last entry in the hash.
qhash-iterator-invalidation-func-desc
Definition at line 1251 of file qhash.h.
References QHash< Key, T >::end().
Returns the current load factor of the QHash's internal hash table.
This is the same as capacity()/size(). The implementation used will aim to keep the load factor between 0.25 and 0.5. This avoids having too many hash table collisions that would degrade performance.
Even with a low load factor, the implementation of the hash table has a very low memory overhead.
This method purely exists for diagnostic purposes and you should rarely need to call it yourself.
Returns the value associated with the key as a modifiable reference.
If the hash contains no item with the key, the function inserts a \l{default-constructed value} into the hash with the key, and returns a reference to it.
! [qhash-iterator-invalidation-func-desc]
\sa insert(), value()
|
inlinenoexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Same as value().
|
inline |
Removes all elements for which the predicate pred returns true from the hash.
The function supports predicates which take either an argument of type {QHash<Key, T>::iterator}, or an argument of type
{std::pair<const Key &, T &>}.
Returns the number of elements removed, if any.
Removes the item with the key from the hash and returns the value associated with it.
If the item does not exist in the hash, the function simply returns a \l{default-constructed value}.
If you don't use the return value, remove() is more efficient.
|
inlinenoexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns the value associated with the key.
If the hash contains no item with the key, the function returns defaultValue, or a \l{default-constructed value} if this parameter has not been supplied.
Returns a list containing all the values in the hash, in an arbitrary order.
The order is guaranteed to be the same as that used by keys().
This function creates a new list, in \l {linear time}. The time and memory use that entails can be avoided by iterating from \l keyValueBegin() to \l keyValueEnd().
|
friend |
|
related |
Removes all elements for which the predicate pred returns true from the hash hash.
The function supports predicates which take either an argument of type {QHash<Key, T>::iterator}, or an argument of type
{std::pair<const Key &, T &>}.
Returns the number of elements removed, if any.
|
friend |
|
related |
Writes the hash hash to stream out.
This function requires the key and value types to implement operator<<()
.
Definition at line 571 of file qdatastream.h.
|
related |
Reads a hash from stream in into hash.
This function requires the key and value types to implement operator>>()
.
Definition at line 571 of file qdatastream.h.
|
related |
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 104 of file qhashfunctions.h.
|
related |
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 174 of file qhashfunctions.h.
|
related |
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 176 of file qhashfunctions.h.
|
related |
Returns the hash value for the key, using seed to seed the calculation.
|
related |
Returns the hash value for the key, using seed to seed the calculation.
|
related |
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 202 of file qhashfunctions.h.
|
related |
Returns the hash value for the key, using seed to seed the calculation.
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 195 of file qhashfunctions.h.
|
related |
Returns the hash value for the key, using seed to seed the calculation.
|
related |
Returns a hash value for coordinate, using seed to seed the calculation.
|
related |
Returns the hash value for the response, using seed to seed the calculation.
Definition at line 208 of file qocspresponse.cpp.
|
related |
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 978 of file qsslcertificate.cpp.
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 334 of file qsslerror.cpp.
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 208 of file qhashfunctions.h.
|
related |
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 212 of file qtyperevision.cpp.
|
related |
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 580 of file qversionnumber.cpp.
|
related |
Returns the hash value for the key, using seed to seed the calculation.
Types T1
and T2
must be supported by qHash().
Definition at line 395 of file qhashfunctions.h.
|
related |
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 182 of file qhashfunctions.h.
|
related |
|
related |
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 162 of file qhashfunctions.h.
|
related |
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 116 of file qhashfunctions.h.
|
related |
|
related |
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 120 of file qhashfunctions.h.
Returns the hash value for the key, using seed to seed the calculation.
|
related |
Returns the hash value for the key, using seed to seed the calculation.
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 129 of file qhashfunctions.h.
|
related |
Returns the hash value for the key, using seed to seed the calculation.
Returns the hash value for the key, using seed to seed the calculation.
|
related |
Returns an hash value for the curve curve, using seed to seed the calculation.
Definition at line 53 of file qsslellipticcurve.h.
Returns the hash value for the key, using seed to seed the calculation.
Returns the hash value for the key, using seed to seed the calculation.
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 123 of file qhashfunctions.h.
|
related |
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 112 of file qhashfunctions.h.
|
related |
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 108 of file qhashfunctions.h.
|
related |
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 186 of file qhashfunctions.h.
|
related |
Returns the hash value for the key, using seed to seed the calculation.
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 106 of file qhashfunctions.h.
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 114 of file qhashfunctions.h.
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 118 of file qhashfunctions.h.
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 110 of file qhashfunctions.h.
|
related |
Returns the hash value for the key, using seed to seed the calculation.
Definition at line 172 of file qhashfunctions.h.
|
related |
Returns the hash value for the memory block of size len pointed to by p, using seed to seed the calculation.
Use this function only to implement qHash() for your own custom types. For example, here's how you could implement a qHash() overload for std::vector<int>:
This takes advantage of the fact that std::vector lays out its data contiguously. If that is not the case, or the contained type has padding, you should use qHashRange() instead.
It bears repeating that the implementation of qHashBits() - like the qHash() overloads offered by Qt - may change at any time. You {must not} rely on the fact that qHashBits() will give the same results (for the same inputs) across different Qt versions.
|
related |
This method is being used by QHash to compare two keys. Returns true if the keys a and b are considered equal for hashing purposes.
The default implementation returns the result of (a == b). It can be reimplemented for a certain type if the equality operator is not suitable for hashing purposes. This is for example the case if the equality operator uses qFuzzyCompare to compare floating point values.
Definition at line 287 of file qhashfunctions.h.
|
related |
Returns the hash value for the {args}, using seed to seed the calculation, by successively applying qHash() to each element and combining the hash values into a single one.
Note that the order of the arguments is significant. If order does not matter, use qHashMultiCommutative() instead. If you are hashing raw memory, use qHashBits(); if you are hashing a range, use qHashRange().
This function is provided as a convenience to implement qHash() for your own custom types. For example, here's how you could implement a qHash() overload for a class {Employee}:
Definition at line 352 of file qhashfunctions.h.
|
related |
Returns the hash value for the {args}, using seed to seed the calculation, by successively applying qHash() to each element and combining the hash values into a single one.
The order of the arguments is insignificant. If order does matter, use qHashMulti() instead, as it may produce better quality hashing. If you are hashing raw memory, use qHashBits(); if you are hashing a range, use qHashRange().
This function is provided as a convenience to implement qHash() for your own custom types.
Definition at line 366 of file qhashfunctions.h.
|
related |
Returns the hash value for the range [{first},{last}), using seed to seed the calculation, by successively applying qHash() to each element and combining the hash values into a single one.
The return value of this function depends on the order of elements in the range. That means that
and
hash to {different} values. If order does not matter, for example for hash tables, use qHashRangeCommutative() instead. If you are hashing raw memory, use qHashBits().
Use this function only to implement qHash() for your own custom types. For example, here's how you could implement a qHash() overload for std::vector<int>:
It bears repeating that the implementation of qHashRange() - like the qHash() overloads offered by Qt - may change at any time. You {must not} rely on the fact that qHashRange() will give the same results (for the same inputs) across different Qt versions, even if qHash() for the element type would.
Definition at line 374 of file qhashfunctions.h.
|
related |
Returns the hash value for the range [{first},{last}), using seed to seed the calculation, by successively applying qHash() to each element and combining the hash values into a single one.
The return value of this function does not depend on the order of elements in the range. That means that
and
hash to the {same} values. If order matters, for example, for vectors and arrays, use qHashRange() instead. If you are hashing raw memory, use qHashBits().
Use this function only to implement qHash() for your own custom types. For example, here's how you could implement a qHash() overload for std::unordered_set<int>:
It bears repeating that the implementation of qHashRangeCommutative() - like the qHash() overloads offered by Qt
Definition at line 381 of file qhashfunctions.h.
|
friend |