diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2020-09-07 15:57:15 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2020-09-15 02:46:40 +0200 |
commit | fb65b32d7621f065ec854f1e72828720bffb3b39 (patch) | |
tree | 7f8bc479ddc552a654f91d998d701f1bbf496d76 /src/corelib/tools/qpoint.cpp | |
parent | 9815ebf24b5aa148a416ee3b159088f0092d2715 (diff) |
Add qHash implementation for QPoint
[ChangeLog][QtCore][QPoint] Added qHash() implementation.
Change-Id: I65332e7aafab53af40a6e11457b9b457196d584c
Fixes: QTBUG-86457
Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qpoint.cpp')
-rw-r--r-- | src/corelib/tools/qpoint.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/corelib/tools/qpoint.cpp b/src/corelib/tools/qpoint.cpp index 432fb33297..eca1b5a0ac 100644 --- a/src/corelib/tools/qpoint.cpp +++ b/src/corelib/tools/qpoint.cpp @@ -41,6 +41,7 @@ #include "qdatastream.h" #include <private/qdebug_p.h> +#include <QtCore/qhashfunctions.h> QT_BEGIN_NAMESPACE @@ -484,6 +485,19 @@ QDebug operator<<(QDebug dbg, const QPointF &p) #endif /*! + \fn size_t qHash(QPoint key, size_t seed = 0) + \relates QHash + \since 6.0 + + Returns the hash value for the \a key, using \a seed to seed the + calculation. +*/ +size_t qHash(QPoint key, size_t seed) noexcept +{ + return qHashMulti(seed, key.x(), key.y()); +} + +/*! \class QPointF \inmodule QtCore \ingroup painting |