src/basics.h

changeset 259
c27612f0eac0
parent 237
10a6298f636f
child 261
6a875faebde2
--- 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 <QStringList>
 #include <QVariant>
 #include <QVector>
+#include <QMdiArea>
 #include <glm/glm.hpp>
 #include "geometry.h"
 #include "functional.h"
@@ -43,8 +44,12 @@
 template<typename T>
 using opt = std::optional<T>;
 
+//! \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<typename T, int N>
@@ -265,7 +270,7 @@
 }
 
 template<typename T, glm::qualifier Q>
-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));
 }

mercurial