diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-04-08 19:44:48 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-05-26 17:51:42 +0000 |
commit | 10d53a3f0e09ec2ef437619bb1bb0dbb40f7ee8b (patch) | |
tree | bb482b1837a3a406089a2fb1f26b3d5e2a5d7461 /src/gui/kernel/qkeysequence.cpp | |
parent | d1de6c521ea2114b3bb6dbe4a0bb302f0a3db434 (diff) |
Add qHash(QKeySequence)
Key sequences can be compared for equality,
so qHash should be overloaded, too.
[ChangeLog][QtGui][QKeySequence] Added qHash(QKeySequence).
Change-Id: I3cf896292459897d66198d96dfcdba1a39bdafce
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/gui/kernel/qkeysequence.cpp')
-rw-r--r-- | src/gui/kernel/qkeysequence.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index 23d5f06aa2..ab846b63cb 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -39,6 +39,7 @@ #ifndef QT_NO_SHORTCUT #include "qdebug.h" +#include <QtCore/qhashfunctions.h> #ifndef QT_NO_REGEXP # include "qregexp.h" #endif @@ -1409,6 +1410,16 @@ bool QKeySequence::operator==(const QKeySequence &other) const d->key[3] == other.d->key[3]); } +/*! + \since 5.6 + + Calculates the hash value of \a key, using + \a seed to seed the calculation. +*/ +uint qHash(const QKeySequence &key, uint seed) Q_DECL_NOTHROW +{ + return qHashRange(key.d->key, key.d->key + QKeySequencePrivate::MaxKeyCount, seed); +} /*! Provides an arbitrary comparison of this key sequence and |