cxx-qt
cxx-qt copied to clipboard
WIP: cxx-qt-lib: add serde support for types
Related to #292
Requires #416
Side note whilst skimming this: It seems this brings up the issue of how stable the binary representation of certain Qt classes is (i.e. QPoint). We should really figure this out first. Does Qt guarantee, by virtue of guaranteeing binary compatibility, that e.g. the layout of QPoint can't change?
If so, we can also keep making members of these classes public, as we don't have to worry about their order changing between minor versions.
Side note whilst skimming this: It seems this brings up the issue of how stable the binary representation of certain Qt classes is (i.e. QPoint). We should really figure this out first. Does Qt guarantee, by virtue of guaranteeing binary compatibility, that e.g. the layout of QPoint can't change?
If so, we can also keep making members of these classes public, as we don't have to worry about their order changing between minor versions.
Right, I think ones like QPoint are unlikely to change, but as we've also seen while investigating QTimeZone that has changed it's layout in future Qt versions.
Eg with QSharedDataPointer
https://github.com/qt/qtbase/blob/v6.4.2/src/corelib/time/qtimezone.h#L152 becoming a Data
(a union with largest size of pointer) https://github.com/qt/qtbase/blob/v6.5.0-beta2/src/corelib/time/qtimezone.h#L242 so i think still the same size ?
Going to pause for 0.5 and consider if we do want to maintain this. As any change in the serde format would break 1.0 release. And if the developer can easily change it to their own types with To/From do we even need to mantain this?