I would like to use a QHash<MyOwnClass&, MyOwnEnum>
(as a member of MyOwnClass
if it does matter). Docs say that one should define a global qhash(MyOwnClass&)
function. OK, for example:
globals.h:
#pragma once
#include "myOwnClass.h"
#include <QHashFunctions>
class MyOwnClass;
inline uint qHash(MyOwnClass& clz);
globals.cpp:
#include "globals.h"
inline uint qHash(MyOwnClass& clz) {
return qHash(clz.getSomeQStringMember());
}
Where should I include my globals.h
, so that the compiler will be able to see and use it?
I'm using MSVS2015 and Qt 5.8. I believe this question is silly and has very simple solution, as long as the answer would help many others like me.