diff options
| author | Olivier De Cannière <olivier.decanniere@qt.io> | 2025-11-27 12:47:35 +0100 |
|---|---|---|
| committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2025-12-06 14:41:50 +0100 |
| commit | 746dba248eea494fe53fe81108e1f880cb095651 (patch) | |
| tree | 2dca9815439e82fed6974400c499ebe5560dae25 /src/corelib/kernel/qmetaobject.cpp | |
| parent | 743f96ffc128abe0412487a2a210b0f423544c0f (diff) | |
moc: Add the hash of a ClassDef to json output
Cpp code generated by qmlcachegen relies on stable metaobject layouts.
They will, however, inevitably change in a incompatible way every now
and then. This renders the cache files compiled with a previous version
and stored on a user's machine invalid and unsafe to use.
There is currently no mechanism to invalidate the cache files if a meta
object breaks compatibility, by adding a signal for instance.
To address this, we can record hashes of the meta objects a compilation
unit relies on and invalidate it when a mismatch is found at runtime
before executing it. We then fall back to other mechanisms to run the
code.
This first step adds the logic to compute the hash of a metaobject to
moc and adds it to its json output.
The hashes are of the form <hash_revision>$<base64_hash>
Task-number: QTBUG-142186
Change-Id: Ifdd56b6259874024341a2b2623d088a45816b0a1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/kernel/qmetaobject.cpp')
0 files changed, 0 insertions, 0 deletions
