cxx-qt icon indicating copy to clipboard operation
cxx-qt copied to clipboard

WIP: cxx-qt-lib: add serde support for types

Open ahayzen-kdab opened this issue 2 years ago • 3 comments

Related to #292

Requires #416

ahayzen-kdab avatar Feb 01 '23 10:02 ahayzen-kdab

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.

LeonMatthesKDAB avatar Feb 15 '23 14:02 LeonMatthesKDAB

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 ?

ahayzen-kdab avatar Feb 15 '23 15:02 ahayzen-kdab

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?

ahayzen-kdab avatar Mar 07 '23 14:03 ahayzen-kdab