diff options
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 |