diff -r fe094d0687ad -r c27612f0eac0 src/basics.h --- a/src/basics.h Wed Jun 22 23:51:06 2022 +0300 +++ b/src/basics.h Sun Jun 26 19:44:45 2022 +0300 @@ -35,6 +35,7 @@ #include #include #include +#include #include #include "geometry.h" #include "functional.h" @@ -43,8 +44,12 @@ template using opt = std::optional; +//! \brief Return type of qHash. unsigned int on Qt5, unsigned long on Qt6. +using hash_t = decltype(qHash(0)); + Q_DECLARE_METATYPE(glm::vec3) Q_DECLARE_METATYPE(glm::mat4) +Q_DECLARE_METATYPE(QMdiArea::ViewMode) //! \brief count the amount of elements in a basic array template @@ -265,7 +270,7 @@ } template -constexpr unsigned int qHash(const glm::vec<3, T, Q>& key) +constexpr auto qHash(const glm::vec<3, T, Q>& key) { return qHash(key.x) ^ rotl10(qHash(key.y)) ^ rotl20(qHash(key.z)); }