mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 19:02:59 +00:00
add a qHash for QUuid
upstream commits:
55d68a16aa
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
55313deba2
commit
731802d03b
2 changed files with 13 additions and 0 deletions
|
@ -918,4 +918,15 @@ QUuid QUuid::createUuid()
|
|||
guid; otherwise returns false.
|
||||
*/
|
||||
|
||||
/**
|
||||
Returns a hash of the QUuid
|
||||
*/
|
||||
uint qHash(const QUuid &uuid)
|
||||
{
|
||||
return uuid.data1 ^ uuid.data2 ^ (uuid.data3 << 16)
|
||||
^ ((uuid.data4[0] << 24) | (uuid.data4[1] << 16) | (uuid.data4[2] << 8) | uuid.data4[3])
|
||||
^ ((uuid.data4[4] << 24) | (uuid.data4[5] << 16) | (uuid.data4[6] << 8) | uuid.data4[7]);
|
||||
}
|
||||
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
@ -185,6 +185,8 @@ Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QUuid &);
|
|||
Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QUuid &);
|
||||
#endif
|
||||
|
||||
Q_CORE_EXPORT uint qHash(const QUuid &uuid);
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
QT_END_HEADER
|
||||
|
|
Loading…
Add table
Reference in a new issue