summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qpoint.cpp14
-rw-r--r--src/corelib/tools/qpoint.h1
2 files changed, 15 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
diff --git a/src/corelib/tools/qpoint.h b/src/corelib/tools/qpoint.h
index 725787265f..e854e77198 100644
--- a/src/corelib/tools/qpoint.h
+++ b/src/corelib/tools/qpoint.h
@@ -214,6 +214,7 @@ constexpr inline const QPoint operator/(const QPoint &p, qreal c)
Q_CORE_EXPORT QDebug operator<<(QDebug, const QPoint &);
#endif
+Q_CORE_EXPORT size_t qHash(QPoint key, size_t seed = 0) noexcept;