mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 10:52:56 +00:00
Revert "add trivial HexString<T>() implementations"
This reverts commit 743835785d
.
This commit is contained in:
parent
b46e70b201
commit
1e2b4cb248
1 changed files with 11 additions and 16 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue