Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <typename T> QByteArray listToArray(const QList<T>& list) {
- QByteArray out;
- QDataStream stream(&out, QIODevice::WriteOnly);
- for (const T& t : list) {
- stream << t;
- }
- return out;
- }
- template <typename T> template <> QByteArray listToArray<QList<T>>(const QList<T>& list) {
- QByteArray out;
- QDataStream stream(&out, QIODevice::WriteOnly);
- for (const T& t : list) {
- stream << listToArray(t);
- }
- return out;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement