/***************************************************************************
- * Copyright (C) 2005-2018 by the Quassel Project *
+ * Copyright (C) 2005-2020 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
inline UserId(int _id = 0)
: SignedId(_id)
{}
- // inline operator QVariant() const { return QVariant::fromValue<UserId>(*this); } // no automatic conversion!
+ // inline operator QVariant() const { return QVariant::fromValue(*this); } // no automatic conversion!
};
struct MsgId : public SignedId64
inline MsgId(qint64 _id = 0)
: SignedId64(_id)
{}
- // inline operator QVariant() const { return QVariant::fromValue<MsgId>(*this); }
+ // inline operator QVariant() const { return QVariant::fromValue(*this); }
};
struct BufferId : public SignedId
inline BufferId(int _id = 0)
: SignedId(_id)
{}
- // inline operator QVariant() const { return QVariant::fromValue<BufferId>(*this); }
+ // inline operator QVariant() const { return QVariant::fromValue(*this); }
};
struct NetworkId : public SignedId
inline NetworkId(int _id = 0)
: SignedId(_id)
{}
- // inline operator QVariant() const { return QVariant::fromValue<NetworkId>(*this); }
+ // inline operator QVariant() const { return QVariant::fromValue(*this); }
};
struct IdentityId : public SignedId
inline IdentityId(int _id = 0)
: SignedId(_id)
{}
- // inline operator QVariant() const { return QVariant::fromValue<IdentityId>(*this); }
+ // inline operator QVariant() const { return QVariant::fromValue(*this); }
};
struct AccountId : public SignedId
using MsgIdList = QList<MsgId>;
using BufferIdList = QList<BufferId>;
+#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
/**
* Catch-all stream serialization operator for enum types.
*
value = static_cast<T>(v);
return in;
}
+#endif
+
+// STL-compliant hash functor for Qt types
+template<typename T>
+struct Hash
+{
+ uint operator()(const T& t) const
+ {
+ return qHash(t);
+ }
+};
// Exceptions