diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2020-01-16 09:22:28 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2020-01-16 09:22:28 +0100 |
commit | 9f41f6ee72fd63c62f68446beef10d37a957e35a (patch) | |
tree | a74b87256c2d284bb9a2061fa323bf36f44b991e /compat | |
parent | 901e06488ae89ff57362a0be534a45eccccbf67a (diff) |
compat/qhash: try fix older Qt
Diffstat (limited to 'compat')
-rw-r--r-- | compat/qhash.hpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/compat/qhash.hpp b/compat/qhash.hpp new file mode 100644 index 00000000..507b612e --- /dev/null +++ b/compat/qhash.hpp @@ -0,0 +1,20 @@ +#pragma once + +#include <QtGlobal> +#include <QString> +#include <QHashFunctions> + +// Qt < 5.14.0 +#ifndef QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH_BY_CREF + +namespace std { +template<> struct hash<QString> +{ + unsigned operator()(const QString& value) const + { + return qHash(value); + } +}; +} + +#endif |