gui: add basic gui code.

This commit is contained in:
2025-06-15 14:31:54 +08:00
parent 72df3216a5
commit 7d123b2c06
40 changed files with 1483 additions and 12 deletions

25
Struct/InfoPack.hpp Normal file
View File

@@ -0,0 +1,25 @@
#ifndef INFO_PACK_HPP
#define INFO_PACK_HPP
#include <QByteArray>
#include <QDataStream>
#include <QDebug>
template <typename T> QByteArray infoPack(const T& obj)
{
QByteArray byteArray;
QDataStream stream(&byteArray, QIODevice::ReadWrite);
obj.serialize(stream);
stream.device()->seek(0);
return byteArray;
}
template <typename T> T infoUnpack(const QByteArray& byteArray)
{
T obj;
QDataStream stream(byteArray);
obj.deserialize(stream);
return obj;
}
#endif // INFO_PACK_HPP