diff --git a/src/core/plugin/quuid.cpp b/src/core/plugin/quuid.cpp index 34d116b97..1887aadde 100644 --- a/src/core/plugin/quuid.cpp +++ b/src/core/plugin/quuid.cpp @@ -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 diff --git a/src/core/plugin/quuid.h b/src/core/plugin/quuid.h index 59af1bf9b..69a403c06 100644 --- a/src/core/plugin/quuid.h +++ b/src/core/plugin/quuid.h @@ -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