diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-02-02 14:24:40 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-02-03 08:49:50 +0100 |
commit | b322a971f06823a4356f2b3aa331501aa4d0dc7f (patch) | |
tree | 4fc44845bb45dec354623d24f7bb895f488c8404 /src/qml | |
parent | 1b93a1d86549347566e1a7645c0501e5c9f6aa0a (diff) |
QQmlIRLoader: Actually load RequiredPropertyExtraData
If a QML component wants to mark properties of its "parent" component as
required, it can do so via
required propertyName
The information about those properties is stored in a
RequiredPropertyExtraData data structure. This structure is already
serialized to disk in the QQmlIRWriter. However, we neglected to restore
it so far in the loader.
Fixes: QTBUG-90538
Pick-to: 5.15 6.0
Change-Id: I789daff9bc881e4f35c942c77f5116b5284de81b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/qml/qqmlirloader.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlirloader.cpp b/src/qml/qml/qqmlirloader.cpp index 5a010e6263..ee75a2b4f7 100644 --- a/src/qml/qml/qqmlirloader.cpp +++ b/src/qml/qml/qqmlirloader.cpp @@ -214,6 +214,13 @@ QmlIR::Object *QQmlIRLoader::loadObject(const QV4::CompiledData::Object *seriali object->inlineComponents->append(ic); } + const QV4::CompiledData::RequiredPropertyExtraData *serializedRequiredPropertyExtraData = serializedObject->requiredPropertyExtraDataTable(); + for (uint i = 0u; i < serializedObject->nRequiredPropertyExtraData; ++i, ++serializedRequiredPropertyExtraData) { + QmlIR::RequiredPropertyExtraData *extra = pool->New<QmlIR::RequiredPropertyExtraData>(); + *static_cast<QV4::CompiledData::RequiredPropertyExtraData *>(extra) = *serializedRequiredPropertyExtraData; + object->requiredPropertyExtraDatas->append(extra); + } + return object; } |