typedef struct struct1{
double x;
double y;
} Point;
typedef struct struct2{
QString name;
struct1 point;
} Project;
请问,QMap< int, struct2 >怎么序列化啊?key值是int型,value值是struct2型,好像不能直接序列化???有没有什么方法将这种情况序列化啊?
typedef struct struct1{
double x;
double y;
} Point;
typedef struct struct2{
QString name;
struct1 point;
} Project;
请问,QMap< int, struct2 >怎么序列化啊?key值是int型,value值是struct2型,好像不能直接序列化???有没有什么方法将这种情况序列化啊?
可以通过重载QDataStream类,具体方法参考: