qt6-bb10/tests/auto/corelib/tools
Marc Mutz c2f4705f23 Add qHash(QHash) and qHash(QMultiHash)
The hash function is carefully designed to give the same result
as the straight-forward implementation of qHash(unordered_map),
which we'll probably add at some point, namely: std::accumulate
over a container of std::pair.

This is one reason to use std:: and not QPair in the implemen-
tation of qHash(QHash). The other is that qHash(QPair) uses a
bad hash combiner, which may xor out the 'seed' from the result.

We can't fix that until Qt 6, but the qHash(std::pair) overload
uses the well-known boost::hash_combine algorithm (implemented
in Qt as QtPrivate::QHashCombine), so we can use that.

I also trust std::pair to work without problems with reference
template arguments, while QPair only very recently gained a very
basic auto-test for reference parameters.

[ChangeLog][QtCore] Added qHash() overloads for QHash, QMultiHash.

Change-Id: I90879d8a99cf1aadb6e84ecc0c3704f52f3691da
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-07-14 06:53:48 +00:00
..
collections Updated license headers 2016-01-21 18:55:18 +00:00
qalgorithms Updated license headers 2016-01-21 18:55:18 +00:00
qarraydata Merge remote-tracking branch 'origin/5.6' into 5.7 2016-05-19 12:55:27 +02:00
qarraydata_strictiterators
qbitarray Updated license headers 2016-01-21 18:55:18 +00:00
qbytearray Merge remote-tracking branch 'origin/5.7' into dev 2016-06-13 12:46:46 +02:00
qbytearraylist Updated license headers 2016-01-21 18:55:18 +00:00
qbytearraymatcher Updated license headers 2016-01-21 18:55:18 +00:00
qbytedatabuffer Updated license headers 2016-01-21 18:55:18 +00:00
qcache Updated license headers 2016-01-21 18:55:18 +00:00
qchar Merge remote-tracking branch 'origin/5.7' into dev 2016-04-05 14:22:45 +02:00
qcollator Remove the traces of the discontinued android-no-sdk platform 2016-03-30 10:12:34 +00:00
qcommandlineparser Merge remote-tracking branch 'origin/5.7' into dev 2016-04-05 14:22:45 +02:00
qcontiguouscache Updated license headers 2016-01-21 18:55:18 +00:00
qcryptographichash Remove the traces of the discontinued android-no-sdk platform 2016-03-30 10:12:34 +00:00
qdate Add Intel copyright to files that Intel has had non-trivial contribution 2016-01-21 22:44:21 +00:00
qdatetime QDateTime: introduce {to,from,set,current}SecsSinceEpoch 2016-06-22 18:34:27 +00:00
qeasingcurve Updated license headers 2016-01-21 18:55:18 +00:00
qexplicitlyshareddatapointer Updated license headers 2016-01-21 18:55:18 +00:00
qfreelist Updated license headers 2016-01-21 18:55:18 +00:00
qhash Add qHash(QHash) and qHash(QMultiHash) 2016-07-14 06:53:48 +00:00
qhash_strictiterators
qhashfunctions Updated license headers 2016-01-21 18:55:18 +00:00
qlatin1string QLatin1String: add at()/op[]/mid()/right()/left() 2016-02-19 18:16:38 +00:00
qline Add QLineF::center() returning the point in the center of the line 2016-05-27 08:49:44 +00:00
qlinkedlist Merge remote-tracking branch 'origin/5.6' into 5.7 2016-05-19 12:55:27 +02:00
qlist Merge remote-tracking branch 'origin/5.6' into 5.7 2016-05-19 12:55:27 +02:00
qlist_strictiterators
qlocale Fix/adapt the uses of {to,set,from}Time_t in the qtbase source code 2016-07-06 06:28:13 +00:00
qmap Merge remote-tracking branch 'origin/5.6' into 5.7 2016-05-19 12:55:27 +02:00
qmap_strictiterators
qmargins Updated license headers 2016-01-21 18:55:18 +00:00
qmessageauthenticationcode Updated license headers 2016-01-21 18:55:18 +00:00
qpair Updated license headers 2016-01-21 18:55:18 +00:00
qpoint Updated license headers 2016-01-21 18:55:18 +00:00
qpointf Updated license headers 2016-01-21 18:55:18 +00:00
qqueue Updated license headers 2016-01-21 18:55:18 +00:00
qrect Merge remote-tracking branch 'origin/5.6' into 5.7 2016-03-21 09:02:57 +01:00
qregexp QtCore: Remove Windows CE. 2016-03-30 11:22:47 +00:00
qregularexpression Updated license headers 2016-01-21 18:55:18 +00:00
qringbuffer Updated license headers 2016-01-21 18:55:18 +00:00
qscopedpointer QSharedPointer/QWeakPointer/QScopedPointer: add comparison against nullptr 2016-06-08 09:09:47 +00:00
qscopedvaluerollback Updated license headers 2016-01-21 18:55:18 +00:00
qset Updated license headers 2016-01-21 18:55:18 +00:00
qsharedpointer QSharedPointer/QWeakPointer/QScopedPointer: add comparison against nullptr 2016-06-08 09:09:47 +00:00
qsize Updated license headers 2016-01-21 18:55:18 +00:00
qsizef Updated license headers 2016-01-21 18:55:18 +00:00
qstl Updated license headers 2016-01-21 18:55:18 +00:00
qstring Collate conversion functions for Core Foundation/Foundation types 2016-05-19 11:20:36 +00:00
qstring_no_cast_from_bytearray Updated license headers 2016-01-21 18:55:18 +00:00
qstringapisymmetry QStringRef: add missing relational operators against QByteArray 2016-06-08 21:42:33 +00:00
qstringbuilder QString: add some missing overloaded operator+ 2016-06-29 14:58:25 +00:00
qstringiterator Updated license headers 2016-01-21 18:55:18 +00:00
qstringlist QtCore: Remove Windows CE. 2016-03-30 11:22:47 +00:00
qstringmatcher Updated license headers 2016-01-21 18:55:18 +00:00
qstringref QStringRef: add chop() 2016-07-07 15:12:27 +00:00
qtextboundaryfinder Remove the traces of the discontinued android-no-sdk platform 2016-03-30 10:12:34 +00:00
qtime Updated license headers 2016-01-21 18:55:18 +00:00
qtimeline Merge remote-tracking branch 'origin/5.7' into dev 2016-05-12 08:33:08 +02:00
qtimezone Merge remote-tracking branch 'origin/5.6' into 5.7 2016-06-06 09:04:55 +02:00
qvarlengtharray Updated license headers 2016-01-21 18:55:18 +00:00
qvector Merge remote-tracking branch 'origin/5.6' into 5.7 2016-05-19 12:55:27 +02:00
qvector_strictiterators
qversionnumber Add QLibraryInfo::version() returning the Qt version as QVersionNumber 2016-04-27 16:12:55 +00:00
tools.pro Move QElapsedTimer to src/corelib/kernel 2016-07-02 07:51:45 +00:00