Revert "add trivial HexString<T>() implementations"

This reverts commit 743835785d.
This commit is contained in:
Ivailo Monev 2021-03-15 20:21:17 +02:00
parent b46e70b201
commit 1e2b4cb248

View file

@ -56,24 +56,19 @@ namespace QStyleHelper
}
// internal helper. Converts an integer value to an unique string token
template <class SRC>
inline QChar HexString(const SRC val)
template <typename T>
struct HexString
{
inline HexString(const T t)
: val(t)
{}
inline operator const QChar() const {
const char *c = reinterpret_cast<const char *>(&val);
return QChar(qChecksum(c, sizeof(SRC)));
}
#define TRIVIAL_HEXSTRING(TYPE) \
template <> \
inline QChar HexString(const TYPE val) \
{ \
return QChar(val); \
}
TRIVIAL_HEXSTRING(uint)
TRIVIAL_HEXSTRING(int)
#undef TRIVIAL_HEXSTRING
return QChar(qChecksum(c ,sizeof(T)));
}
const T val;
};
QT_END_NAMESPACE