summaryrefslogtreecommitdiffhomepage
path: root/compat
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2020-01-16 09:22:28 +0100
committerStanislaw Halik <sthalik@misaki.pl>2020-01-16 09:22:28 +0100
commit9f41f6ee72fd63c62f68446beef10d37a957e35a (patch)
treea74b87256c2d284bb9a2061fa323bf36f44b991e /compat
parent901e06488ae89ff57362a0be534a45eccccbf67a (diff)
compat/qhash: try fix older Qt
Diffstat (limited to 'compat')
-rw-r--r--compat/qhash.hpp20
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