I have a \"User
\" class with 40+ private variables including complex objects like private/public keys (QCA library), custom QObjects etc. The idea is that the
Binary dump serialization is a bad idea, it will include a lot of stuff you don't need like the object's v-table pointer, as well as other pointers, contained directly or from other class members, which make no sense to be serialized, since they do not persist between application sessions.
If it is just a single class, just implement it by hand, it certainly won't kill you. If you have a family of classes, and they are QObject
derived, you could use the meta system, but that will only register properties, whereas a int something
member which is not tied to a property will be skipped. If you have a lot of data members which are not Qt properties, it will take you more typing to expose them as Qt properties, unnecessarily I might add, than it would take to write the serialization method by hand.