The type system of C++ can not get the full type when build. if you
define two same class names like "Mount" in the global namespace, there
is no way to deserialize it because of name conflict. But when you put
it in a different namespace, the qRegisterMetaType can not deduce
the full namespace of "Mount", it can not find the exact converter
function by the template.
The only fix is to set the full namespace when you use Q_PROPERTY
or Q_JSON_PROPERTY/Q_JSON_PTR_PROPERTY in this project. for example:
Q_JSON_PROPERTY(linglong::test::MountList, mounts);
Also you should do that:
1. D_SERIALIZE_DECLARE(Mount) just behind class Mount;
2. D_SERIALIZE_REGISTER_TYPE_NM(linglong::test, MountRule) in the header
file in global namespace;
3. call qJsonRegister<linglong::test::Mount>() only once before
you use this serialize system;
TODO:
The serialize code should spilt to meta_serialize.h and json.h/yaml.h
just process the special file format.
Change-Id: I1eb7d68097eb71d07ea0e1421c078a3d65e86b1a